Calculates polynomials that interpolatethe two dimensional data. The polynomial order is equal to the number of data points - 1.
In general a polynomial with degree = datapointNumber - 1 is flexible enough to interpolate all datapoints. But polynomial regression with degree = datapointNumber - 1 cannot be used for polynomial interpolation because the least squares approach is not sufficient to converge interpolating.
Type | Description |
Function or value | Description |
Full Usage:
differentiate coef level
Parameters:
PolynomialCoef
-
polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [constant;linear;quadratic;...]
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.
Example
|
Full Usage:
getDerivative coef level x
Parameters:
PolynomialCoef
-
polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [constant;linear;quadratic;...]
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 ...
Example
|
Full Usage:
getIntegralBetween coef x1 x2
Parameters:
PolynomialCoef
-
polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [constant;linear;quadratic;...]
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
|
Full Usage:
integrate coef
Parameters:
PolynomialCoef
-
polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [constant;linear;quadratic;...]
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.
Example
|
Full Usage:
interpolate xData yData
Parameters:
Vector<float>
-
Note: Must not contain duplicate x values (use Approximation.regularizeValues to preprocess data!)
yData : Vector<float>
-
vector of y values
Returns: PolynomialCoef
vector of polynomial coefficients sorted as [constant;linear;quadratic;...]
|
No duplicates allowed!
Example
|
Full Usage:
predict coef x
Parameters:
PolynomialCoef
-
polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [constant;linear;quadratic;...]
x : float
-
x value of which the corresponding y value should be predicted
Returns: float
predicted y value with given polynomial coefficients at X=x
|
Example
|