lowess_fit() should allow extrapolation
Issue #60
resolved
currently we interpolate between the x-values to which the lowess fit was performed
we could use scipy.interpolate.interp1d(..., fill_value='extrapolate')
to get extrapolation for x-values beyond the range of those for which the lowess curve was fitted
the extrapolation could be controlled/disabled using the boundary condition kwargs which are already present
an example implementation is to replace
y_hat = np.interp(new_x, sorted_x, sorted_y_hat)
with
y_hat = scipy.interpolate.interp1d(sorted_x, sorted_y_hat, fill_value='extrapolate', assume_sorted=True)(new_x)
in lib5c.util.lowess.lowess_fit()
Comments (4)
-
reporter -
reporter fixed by ef66be6
-
reporter - changed status to resolved
-
reporter this is now live in lib5c 0.5.5
- Log in to comment
this has been bootlegged by fast3defdr and appears to be working well in the wild
https://bitbucket.org/creminslab/fast3defdr/commits/b691ee3b2836f1b8790986f8f6225fd68e1460d4