CubicSplineCoef Type

Contains x data, y data (c0), slopes (c1), curvatures (c2), and the third derivative at each knot

Record fields

Record Field Description

C0_3

Full Usage: C0_3

Field type: vector

vector of [a0;b0;c0;d0;a1;b1;...;d(n-2)] where f_n(x) = (an)x^3 + (bn)x^2 + (cn)x + (dn)

Field type: vector

XData

Full Usage: XData

Field type: vector
Field type: vector

Instance members

Instance member Description

this.Predict

Full Usage: this.Predict

Returns: float -> float Function that takes an x value and returns function value.

Returns function that takes x value and predicts the corresponding interpolating y value.

x values outside of the xValue range are predicted by straight lines defined by the nearest knot!

Returns: float -> float

Function that takes an x value and returns function value.

Example

 
 // e.g. days since a certain event
 let xData = vector [|0.;1.;5.;4.;3.;|]
 // some measured feature
 let yData = vector [|1.;5.;4.;13.;17.|]
 
 // get coefficients for piecewise interpolating cubic polynomials
 let coefficients = 
     CubicSpline.interpolate CubicSpline.BoundaryConditions.Natural xData yData

 // get function value at x=3.4
 coefficients.Predict 3.4

this.PredictWithinRange

Full Usage: this.PredictWithinRange

Returns: float -> float Function that takes an x value and returns function value.

Returns function that takes x value (that lies within the range of input x values) and predicts the corresponding interpolating y value.

Only defined within the range of the given xValues!

Returns: float -> float

Function that takes an x value and returns function value.

Example

 
 // e.g. days since a certain event
 let xData = vector [|0.;1.;5.;4.;3.;|]
 // some measured feature
 let yData = vector [|1.;5.;4.;13.;17.|]
 
 // get coefficients for piecewise interpolating cubic polynomials
 let coefficients = 
     CubicSpline.interpolate CubicSpline.BoundaryConditions.Natural xData yData

 // get function value at x=3.4
 coefficients.PredictWithinRange 3.4

Static members

Static member Description

CubicSplineCoef.Create(x) (c)

Full Usage: CubicSplineCoef.Create(x) (c)

Parameters:
Returns: CubicSplineCoef
x : vector
c : vector
Returns: CubicSplineCoef