StepCoef Type

Record type that contains the x-knots, intersects (C0) and slopes (C1) of each interval.

Equivalent to interval-wise simple linear regression between any neighbouring pair of data.

Record fields

Record Field Description

C0

Full Usage: C0

Field type: float[]

Zero order spline coefficients (n), corresponding to line intersects

Field type: float[]

XValues

Full Usage: XValues

Field type: float[]

sample points (n+1), sorted ascending

Field type: float[]

Instance members

Instance member Description

this.Differentiate

Full Usage: this.Differentiate

Returns: StepCoef Coefficients of the fst derivative of the linear spline

Determines the coefficients of the derivative of the given step function.

Returns: StepCoef

Coefficients of the fst derivative of the linear spline

this.Predict

Full Usage: this.Predict

Returns: float -> float Y value corresponding to the given x value.

Predicts the y value at point x. A straight line is fitted between the neighboring x values given.

X values that don't not lie within the range of the input x values, are predicted using the nearest interpolation line!

Returns: float -> float

Y value corresponding to the given x 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 slopes and intersects for interpolating straight lines
 let coefficients = 
     Interpolation.Step.interpolate xData yData 

 // get y value at 3.4
 coefficients.Predict 3.4

this.getDerivative x

Full Usage: this.getDerivative x

Parameters:
    x : 'a - x value of which the corresponding y value slope should be predicted

Returns: float predicted slope of given step function at X=x

Calculates slope values at X=x with given step function coefficients.

x : 'a

x value of which the corresponding y value slope should be predicted

Returns: float

predicted slope of given step function at X=x

Static members

Static member Description

StepCoef.Create(xValues) (c0)

Full Usage: StepCoef.Create(xValues) (c0)

Parameters:
    xValues : float[]
    c0 : float[]

Returns: StepCoef
xValues : float[]
c0 : float[]
Returns: StepCoef