Module to create linear splines from x,y coordinates. x,y coordinates are interpolated by straight lines between two knots.
Equivalent to interval-wise simple linear regression between any neighbouring pair of data.
Type | Description |
Function or value | Description |
Full Usage:
differentiate lsc x
Parameters:
LinearSplineCoef
-
Linear spline coefficients given as input x values, intersects, and slopes.
x : float
-
X value at which the corresponding slope should be predicted
Returns: float
Slope of the function at the given x value.
|
Predicts the slope at point x. Since linear splines are lines between each pair of adjacend knots, the slope of the function within the interval of adjacent knots is constant. X values that don't lie within the range of the input x values, are predicted using the nearest interpolation line!
Example
|
Full Usage:
interpolate xData yData
Parameters:
float array
-
Collection of x values.
yData : float array
-
Collection of y values.
Returns: LinearSplineCoef
x-values, intersects, and slopes of interpolating lines
|
Must not contain duplicate x values. Use Approximation.regularizeValues to preprocess data!
Example
|
Full Usage:
interpolateInplace xData yData
Parameters:
float array
-
Collection of x values. May be modified when running this function!
yData : float array
-
Collection of y values. May be modified when running this function!
Returns: LinearSplineCoef
x-values, intersects, and slopes of interpolating lines
|
Returns the linear spline interpolation coefficients from unsorted x,y data. Works in place and modifies input sequences! Works in place!Must not contain duplicate x values. Use Approximation.regularizeValues to preprocess data!
Example
|
Full Usage:
interpolateSorted xData yData
Parameters:
float array
-
Collection of ascending x values
yData : float array
-
Collection of y values
Returns: LinearSplineCoef
x-values, intersects, and slopes of interpolating lines
|
Returns the linear spline interpolation coefficients from x,y data that is sorted ascending according to x values. The intersects (C0) correspond to the input y values.Must not contain duplicate x values. Use Approximation.regularizeValues to preprocess data!
Example
|
Full Usage:
predict lsc x
Parameters:
LinearSplineCoef
-
Linear spline coefficients given as input x values, intersects, and slopes.
x : float
-
X value at which the corresponding y value should be predicted
Returns: float
Y value corresponding to the given x value.
|
X values that don't not lie within the range of the input x values, are predicted using the nearest interpolation line!
Example
|