PolynomialCoef Type

contains polynomial coefficients sorted from intercept to highest order factor

Record fields

Record Field Description

C0_CX

Full Usage: C0_CX

Field type: Vector<float>

vector of polynomial coefficients sorted as [constant;linear;quadratic;...]

Field type: Vector<float>

Instance members

Instance member Description

this.Differentiate

Full Usage: this.Differentiate

Parameters:
    level : int - Level of differentiation: 1 = fst derivative, 2 = snd derivative, ... .

Returns: PolynomialCoef Coefficients of the derivative polynomial

Determines the coefficients of the derivative of the given polynomial. Level 1 = fst derivative, level 2 = snd derivative, ... . The resulting polynomial is `level` degrees lower than the original polynomial.

level : int

Level of differentiation: 1 = fst derivative, 2 = snd derivative, ... .

Returns: PolynomialCoef

Coefficients of the derivative polynomial

Example

 
 // e.g. days since a certain event
 let xData = vector [|1.;2.;3.;4.;5.;6.|]
 // e.g. temperature measured at noon of the days specified in xData 
 let yData = vector [|4.;7.;9.;8.;7.;9.;|]
 
 // Estimate the polynomial coefficients. In Interpolation the order is equal to the data length - 1.
 let coefficients = 
     Interpolation.Polynomial.coefficients xData yData 
 
 // Get curvature function coefficients. 
 Interpolation.Polynomial.Differentiate 2

this.GetDerivative

Full Usage: this.GetDerivative

Parameters:
    level : int - depth of derivative: 1 = slope, 2 = curvature, ...
    x : float - x value of which the corresponding y value should be predicted

Returns: float predicted derivative with given polynomial coefficients at X=x

calculates derivative values at X=x with given polynomial coefficients. Level 1 = fst derivative; Level2 = snd derivative ...

level : int

depth of derivative: 1 = slope, 2 = curvature, ...

x : float

x value of which the corresponding y value should be predicted

Returns: float

predicted derivative with given polynomial coefficients at X=x

Example

 
 // e.g. days since a certain event
 let xData = vector [|1.;2.;3.;4.;5.;6.|]
 // e.g. temperature measured at noon of the days specified in xData 
 let yData = vector [|4.;7.;9.;8.;7.;9.;|]
 
 // Estimate the polynomial coefficients. In Interpolation the order is equal to the data length - 1.
 let coefficients = 
     Interpolation.Polynomial.coefficients xData yData 
 
 // Predict the curvature of the interpolating function at midnight between day 1 and 2. 
 Interpolation.Polynomial.GetDerivative 2 1.5

this.GetIntegralBetween

Full Usage: this.GetIntegralBetween

Parameters:
    x1 : float - start x value
    x2 : float - end x value

Returns: float integral of the polynomial in the range defined by x1 and x2

calculates the area under the curve from x=x1 to x=x2 with given polynomial coefficients.

x1 : float

start x value

x2 : float

end x value

Returns: float

integral of the polynomial in the range defined by x1 and x2

Example

 
 // e.g. days since a certain event
 let xData = vector [|1.;2.;3.;4.;5.;6.|]
 // e.g. temperature measured at noon of the days specified in xData 
 let yData = vector [|4.;7.;9.;8.;7.;9.;|]
 
 // Estimate the polynomial coefficients. In Interpolation the order is equal to the data length - 1.
 let coefficients = 
     Interpolation.Polynomial.coefficients xData yData 
 
 // Get area under the curve between x=0 and x=2. 
 Interpolation.Polynomial.GetIntegralBetween 0. 2.

this.Integrate

Full Usage: this.Integrate

Returns: PolynomialCoef Coefficients of the integral polynomial

Determines the coefficients of the integral of the given polynomial. The resulting polynomial is one degree higher than the original polynomial.

Returns: PolynomialCoef

Coefficients of the integral polynomial

Example

 
 // e.g. days since a certain event
 let xData = vector [|1.;2.;3.;4.;5.;6.|]
 // e.g. temperature measured at noon of the days specified in xData 
 let yData = vector [|4.;7.;9.;8.;7.;9.;|]
 
 // Estimate the polynomial coefficients. In Interpolation the order is equal to the data length - 1.
 let coefficients = 
     Interpolation.Polynomial.coefficients xData yData 
 
 // Get integral function coefficients. 
 Interpolation.Polynomial.Integrate()

this.Predict

Full Usage: this.Predict

Returns: float -> float predicted y value with given polynomial coefficients at X=x

takes x value to predict the corresponding interpolating y value

Returns: float -> float

predicted y value with given polynomial coefficients at X=x

Example

 
 // e.g. days since a certain event
 let xData = vector [|1.;2.;3.;4.;5.;6.|]
 // e.g. temperature measured at noon of the days specified in xData 
 let yData = vector [|4.;7.;9.;8.;7.;9.;|]
 
 // Estimate the polynomial coefficients. In Interpolation the order is equal to the data length - 1.
 let coefficients = 
     Interpolation.Polynomial.coefficients xData yData 
 
 // Predict the temperature value at midnight between day 1 and 2. 
 coefficients.Predict 1.5

Static members

Static member Description

PolynomialCoef.Create(c)

Full Usage: PolynomialCoef.Create(c)

Parameters:
Returns: PolynomialCoef
c : Vector<float>
Returns: PolynomialCoef