public class MultipleLinearRegression
extends java.lang.Object
The population regression line for p explanatory variables x1, x2, ... , xp is defined to be y = b0 + b1*x1 + b2*x2 + ... + bp*xp + e.
Modifier and Type | Field and Description |
---|---|
private double[] |
b
The (p+1 x 1) - double[] holding the estimated b-values (b0, b1, ...,
bp)^T.
|
private double[] |
e
The (n x 1) - double[] 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 double[][] |
x
The (n x p+1)-matrix holding the x-values, where the i-th row has the form
(1 x1i ... x1p).
|
private double[][] |
xx_inverse
Holds the matrix (x'x)^-1.
|
private double[] |
y
The (n x 1) - double[] holding the y-values (y1, ..., yn)^T.
|
private double |
y_mean
Holds the mean value of the y-values.
|
Constructor and Description |
---|
MultipleLinearRegression(double[] y,
double[][] x)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
coefficientOfDetermination()
Returns the coefficient of determination
|
double |
estimateY(double[][] x)
Perform an estimation of y on the specified matrix.
|
double[] |
getEstimatedCoefficients()
Returns the estimated coefficients
|
double[] |
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.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
private final double[] y
private final double y_mean
private final double[][] x
private final double[] b
private final double[] e
private final double variance
private final double[][] xx_inverse
private final double ssr
private final double sst
public MultipleLinearRegression(double[] y, double[][] x)
y
- the (n x 1) - double[] 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).public java.lang.String toString()
toString
in class java.lang.Object
public double getSumOfSquaresTotal()
public double getSumOfSquareResiduals()
public double[] getEstimatedCoefficients()
public double[] getEstimatedResiduals()
public double coefficientOfDetermination()
public double estimateY(double[][] x)
x
- the matrix for which y is estimatedpublic double getVariance()
Copyright © 2019 ELKI Development Team. License information.