|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.stat.regression.AbstractMultipleLinearRegression
public abstract class AbstractMultipleLinearRegression
Abstract base class for implementations of MultipleLinearRegression.
Field Summary | |
---|---|
protected RealMatrix |
X
X sample data. |
protected RealVector |
Y
Y sample data. |
Constructor Summary | |
---|---|
AbstractMultipleLinearRegression()
|
Method Summary | |
---|---|
protected abstract RealVector |
calculateBeta()
Calculates the beta of multiple linear regression in matrix notation. |
protected abstract RealMatrix |
calculateBetaVariance()
Calculates the beta variance of multiple linear regression in matrix notation. |
protected RealVector |
calculateResiduals()
Calculates the residuals of multiple linear regression in matrix notation. |
protected abstract double |
calculateYVariance()
Calculates the Y variance of multiple linear regression. |
double |
estimateRegressandVariance()
Returns the variance of the regressand, ie Var(y). |
double[] |
estimateRegressionParameters()
Estimates the regression parameters b. |
double[] |
estimateRegressionParametersStandardErrors()
Returns the standard errors of the regression parameters. |
double[][] |
estimateRegressionParametersVariance()
Estimates the variance of the regression parameters, ie Var(b). |
double[] |
estimateResiduals()
Estimates the residuals, ie u = y - X*b. |
void |
newSampleData(double[] data,
int nobs,
int nvars)
Loads model x and y sample data from a flat array of data, overriding any previous sample. |
protected void |
newXSampleData(double[][] x)
Loads new x sample data, overriding any previous sample |
protected void |
newYSampleData(double[] y)
Loads new y sample data, overriding any previous sample |
protected void |
validateCovarianceData(double[][] x,
double[][] covariance)
Validates sample data. |
protected void |
validateSampleData(double[][] x,
double[] y)
Validates sample data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RealMatrix X
protected RealVector Y
Constructor Detail |
---|
public AbstractMultipleLinearRegression()
Method Detail |
---|
public void newSampleData(double[] data, int nobs, int nvars)
data
- input data arraynobs
- number of observations (rows)nvars
- number of independent variables (columns, not counting y)protected void newYSampleData(double[] y)
y
- the [n,1] array representing the y sampleprotected void newXSampleData(double[][] x)
x
- the [n,k] array representing the x sampleprotected void validateSampleData(double[][] x, double[] y)
x
- the [n,k] array representing the x sampley
- the [n,1] array representing the y sample
IllegalArgumentException
- if the x and y array data are not
compatible for the regressionprotected void validateCovarianceData(double[][] x, double[][] covariance)
x
- the [n,k] array representing the x samplecovariance
- the [n,n] array representing the covariance matrix
IllegalArgumentException
- if the x sample data or covariance
matrix are not compatible for the regressionpublic double[] estimateRegressionParameters()
estimateRegressionParameters
in interface MultipleLinearRegression
public double[] estimateResiduals()
estimateResiduals
in interface MultipleLinearRegression
public double[][] estimateRegressionParametersVariance()
estimateRegressionParametersVariance
in interface MultipleLinearRegression
public double[] estimateRegressionParametersStandardErrors()
estimateRegressionParametersStandardErrors
in interface MultipleLinearRegression
public double estimateRegressandVariance()
estimateRegressandVariance
in interface MultipleLinearRegression
protected abstract RealVector calculateBeta()
protected abstract RealMatrix calculateBetaVariance()
protected abstract double calculateYVariance()
protected RealVector calculateResiduals()
u = y - X * b
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |