public class PolynomialRegression extends MultipleLinearRegression
The regression model y = b0 + b1*x + b2*x^2 + ... + bp*x^p + e is a system of polynomial equations of order p with polynomial coefficients { b0 ... bp}. The model can be expressed using data matrix x, target double[] y and parameter double[] ?. The ith row of X and Y will contain the x and y value for the ith data sample.
The variables will be transformed in the following way: x => x1, ..., x^p => xp Then the model can be written as a multiple linear equation model: y = b0 + b1*x1 + b2*x2 + ... + bp*xp + e
Modifier and Type | Field and Description |
---|---|
int |
p
The order of the polynom.
|
Constructor and Description |
---|
PolynomialRegression(double[] y,
double[] x,
int p)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
adaptedCoefficientOfDetermination()
Returns the adapted coefficient of determination
|
double |
estimateY(double x)
Performs an estimation of y on the specified x value.
|
private static double[][] |
xMatrix(double[] x,
int p) |
coefficientOfDetermination, estimateY, getEstimatedCoefficients, getEstimatedResiduals, getSumOfSquareResiduals, getSumOfSquaresTotal, getVariance, toString
public PolynomialRegression(double[] y, double[] x, int p)
y
- the (n x 1) - double[] holding the response values (y1, ..., yn)^T.x
- the (n x 1)-double[] holding the x-values (x1, ..., xn)^T.p
- the order of the polynom.private static double[][] xMatrix(double[] x, int p)
public double adaptedCoefficientOfDetermination()
public double estimateY(double x)
x
- the x-value for which y is estimatedCopyright © 2019 ELKI Development Team. License information.