de.lmu.ifi.dbs.elki.math.statistics
Class PolynomialRegression

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.statistics.MultipleLinearRegression
      extended by de.lmu.ifi.dbs.elki.math.statistics.PolynomialRegression

public class PolynomialRegression
extends MultipleLinearRegression

A polynomial fit is a specific type of multiple regression. The simple regression model (a first-order polynomial) can be trivially extended to higher orders.

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 vector y and parameter vector ?. 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


Field Summary
 int p
          The order of the polynom.
 
Constructor Summary
PolynomialRegression(Vector y, Vector x, int p)
          Provides a new polynomial regression model with the specified parameters.
 
Method Summary
 double adaptedCoefficientOfDetermination()
          Returns the adapted coefficient of determination
 double estimateY(double x)
          Performs an estimation of y on the specified x value.
private static Matrix xMatrix(Vector x, int p)
           
 
Methods inherited from class de.lmu.ifi.dbs.elki.math.statistics.MultipleLinearRegression
coefficientOfDetermination, estimateY, getEstimatedCoefficients, getEstimatedResiduals, getSumOfSquareResiduals, getSumOfSquaresTotal, getVariance, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p

public final int p
The order of the polynom.

Constructor Detail

PolynomialRegression

public PolynomialRegression(Vector y,
                            Vector x,
                            int p)
Provides a new polynomial regression model with the specified parameters.

Parameters:
y - the (n x 1) - vector holding the response values (y1, ..., yn)^T.
x - the (n x 1)-vector holding the x-values (x1, ..., xn)^T.
p - the order of the polynom.
Method Detail

xMatrix

private static Matrix xMatrix(Vector x,
                              int p)

adaptedCoefficientOfDetermination

public double adaptedCoefficientOfDetermination()
Returns the adapted coefficient of determination

Returns:
the adapted coefficient of determination

estimateY

public double estimateY(double x)
Performs an estimation of y on the specified x value.

Parameters:
x - the x-value for which y is estimated
Returns:
the estimation of y

Release 0.4.0 (2011-09-20_1324)