Polynomial Module
Linear regression using polynomials as regression function: f(x) = a + bx + cx^2 + ....
Functions and values
| Function or value | Description |
Full Usage:
cooksDistance order xData yData
Parameters:
int
-
order of the polynomial (1 = linear, 2 = quadratic, ... )
xData : Vector<float>
-
vector of x values
yData : Vector<float>
-
vector of y values
Returns: Vector<float>
returns collection of cooks distances for each data point
|
Example
val xData: obj
val yData: obj
val distances: obj
|
Full Usage:
fit order xData yData
Parameters:
int
-
order of the polynomial (1 = linear, 2 = quadratic, ... )
xData : Vector<float>
-
vector of x values
yData : Vector<float>
-
vector of y values
Returns: Coefficients
vector of polynomial coefficients sorted as [intercept;constant;quadratic;...]
|
Example
val xData: obj
val yData: obj
val coefficients: obj
|
Full Usage:
fitWithWeighting order weighting xData yData
Parameters:
int
-
order of the polynomial (1 = linear, 2 = quadratic, ... )
weighting : Vector<float>
-
Vector of weightings that define the releveance of each point for fitting.
xData : Vector<float>
-
vector of x values
yData : Vector<float>
-
vector of y values
Returns: Coefficients
vector of polynomial coefficients sorted as [intercept;constant;quadratic;...]
|
Example
val xData: obj
val yData: obj
val coefficients: obj
|
Full Usage:
getDerivative coef level x
Parameters:
Coefficients
-
vector of polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [intercept;constant;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
|
Example
val xData: obj
val yData: obj
val coefficients: obj
|
Full Usage:
predict coef x
Parameters:
Coefficients
-
vector of polynomial coefficients (e.g. determined by Polynomial.coefficients), sorted as [intercept;constant;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
|
If all coefficients are nonzero, the order is equal to the length of the coefficient vector!
Example
val xData: obj
val yData: obj
val coefficients: obj
|
FSharp.Stats