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

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.math.statistics.MultipleLinearRegression
Direct Known Subclasses:
PolynomialRegression

public class MultipleLinearRegression
extends Object

Multiple linear regression attempts to model the relationship between two or more explanatory variables and a response variable by fitting a linear equation to observed data. Every value of the independent variable x is associated with a value of the dependent variable y.

The population regression line for p explanatory variables x1, x2, ... , xp is defined to be y = b0 + b1*x1 + b2*x2 + ... + bp*xp + e.


Field Summary
private  Vector b
          The (p+1 x 1) - vector holding the estimated b-values (b0, b1, ..., bp)^T.
private  Vector e
          The (n x 1) - vector holding the estimated residuals (e1, ..., en)^T.
private  double ssr
          The sum of square residuals
private  double sst
          The sum of square totals
private  double variance
          The error variance.
private  Matrix x
          The (n x p+1)-matrix holding the x-values, where the i-th row has the form (1 x1i ... x1p).
private  Matrix xx_inverse
          Holds the matrix (x'x)^-1.
private  Vector y
          The (n x 1) - vector holding the y-values (y1, ..., yn)^T.
private  double y_mean
          Holds the mean value of the y-values.
 
Constructor Summary
MultipleLinearRegression(Vector y, Matrix x)
          Provides a new multiple linear regression model with the specified parameters.
 
Method Summary
 double coefficientOfDetermination()
          Returns the coefficient of determination
 double estimateY(Matrix x)
          Perform an estimation of y on the specified matrix.
 Vector getEstimatedCoefficients()
          Returns the estimated coefficients
 Vector getEstimatedResiduals()
          Returns the estimated residuals
 double getSumOfSquareResiduals()
          Returns the sum of square residuals.
 double getSumOfSquaresTotal()
          Returns the sum of squares total.
 double getVariance()
          Returns the error variance.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

y

private final Vector y
The (n x 1) - vector holding the y-values (y1, ..., yn)^T.


y_mean

private final double y_mean
Holds the mean value of the y-values.


x

private final Matrix x
The (n x p+1)-matrix holding the x-values, where the i-th row has the form (1 x1i ... x1p).


b

private final Vector b
The (p+1 x 1) - vector holding the estimated b-values (b0, b1, ..., bp)^T.


e

private final Vector e
The (n x 1) - vector holding the estimated residuals (e1, ..., en)^T.


variance

private final double variance
The error variance.


xx_inverse

private final Matrix xx_inverse
Holds the matrix (x'x)^-1.


ssr

private final double ssr
The sum of square residuals


sst

private final double sst
The sum of square totals

Constructor Detail

MultipleLinearRegression

public MultipleLinearRegression(Vector y,
                                Matrix x)
Provides a new multiple linear regression model with the specified parameters.

Parameters:
y - the (n x 1) - vector holding the response values (y1, ..., yn)^T.
x - the (n x p+1)-matrix holding the explanatory values, where the i-th row has the form (1 x1i ... x1p).
Method Detail

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.

getSumOfSquaresTotal

public double getSumOfSquaresTotal()
Returns the sum of squares total.

Returns:
the sum of squares total

getSumOfSquareResiduals

public double getSumOfSquareResiduals()
Returns the sum of square residuals.

Returns:
the sum of square residuals

getEstimatedCoefficients

public Vector getEstimatedCoefficients()
Returns the estimated coefficients

Returns:
the estimated coefficients

getEstimatedResiduals

public Vector getEstimatedResiduals()
Returns the estimated residuals

Returns:
the estimated residuals

coefficientOfDetermination

public double coefficientOfDetermination()
Returns the coefficient of determination

Returns:
the coefficient of determination

estimateY

public double estimateY(Matrix x)
Perform an estimation of y on the specified matrix.

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

getVariance

public double getVariance()
Returns the error variance.

Returns:
the error variance

Release 0.4.0 (2011-09-20_1324)