Data.extrapolate¶
- Data.extrapolate(new_x, xcol=None, ycol=None, yerr=None, overlap=20, kind='linear', errors=None)¶
Extrapolate data based on local fit to x,y data.
- Parameters:
new_x (float or array) – New values of x data.
- Keyword Arguments:
xcol (column index, None) – column containing x-data or None to use setas attribute
ycol (column index(es) or None) – column(s) containing the y-data or None to use setas attribute.
yerr (column index(es) or None) – y error data column or None to use setas attribute
overlap (float or int) – range of x-data used for the local fit for extrapolating. If int then overlap number of points is used, if float then that range x-axis space is used.
kind (str or callable) – Determines local fitting function. If string should be “linear”, “quadratic” or “cubic” if callable, then represents a function to be fitted to the data.
errors (callable or None) – If kind is a callable function, then errs must be defined and must also be a callable function.
- Returns:
(array) – Extrapolated values.
Note
If the new_x values lie outside the span of the x-data, then the nearest overlap portion of the data is used to estimate the values. If the new_x values are within the span of the x-data then the portion of the data centred about the point and overlap points long will be used to interpolate a value.
If kind is callable, it should take x values in the first parameter and free fitting parameters as the other parameters (i.e. as with
AnalysisMixin.curve_fit()
).