|
||||||||||
| 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
org.apache.commons.math.stat.regression.GLSMultipleLinearRegression
public class GLSMultipleLinearRegression
The GLS implementation of the multiple linear regression. GLS assumes a general covariance matrix Omega of the error
u ~ N(0, Omega)Estimated by GLS,
b=(X' Omega^-1 X)^-1X'Omega^-1 ywhose variance is
Var(b)=(X' Omega^-1 X)^-1
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.math.stat.regression.AbstractMultipleLinearRegression |
|---|
X, Y |
| Constructor Summary | |
|---|---|
GLSMultipleLinearRegression()
|
|
| Method Summary | |
|---|---|
protected RealVector |
calculateBeta()
Calculates beta by GLS. |
protected RealMatrix |
calculateBetaVariance()
Calculates the variance on the beta. |
protected double |
calculateErrorVariance()
Calculates the estimated variance of the error term using the formula |
protected RealMatrix |
getOmegaInverse()
Get the inverse of the covariance. |
protected void |
newCovarianceData(double[][] omega)
Add the covariance data. |
void |
newSampleData(double[] y,
double[][] x,
double[][] covariance)
Replace sample data, overriding any previous sample. |
| Methods inherited from class org.apache.commons.math.stat.regression.AbstractMultipleLinearRegression |
|---|
calculateResiduals, calculateYVariance, estimateErrorVariance, estimateRegressandVariance, estimateRegressionParameters, estimateRegressionParametersStandardErrors, estimateRegressionParametersVariance, estimateRegressionStandardError, estimateResiduals, isNoIntercept, newSampleData, newXSampleData, newYSampleData, setNoIntercept, validateCovarianceData, validateSampleData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GLSMultipleLinearRegression()
| Method Detail |
|---|
public void newSampleData(double[] y,
double[][] x,
double[][] covariance)
y - y values of the samplex - x values of the samplecovariance - array representing the covariance matrixprotected void newCovarianceData(double[][] omega)
omega - the [n,n] array representing the covarianceprotected RealMatrix getOmegaInverse()
The inverse of the covariance matrix is lazily evaluated and cached.
protected RealVector calculateBeta()
b=(X' Omega^-1 X)^-1X'Omega^-1 y
calculateBeta in class AbstractMultipleLinearRegressionprotected RealMatrix calculateBetaVariance()
Var(b)=(X' Omega^-1 X)^-1
calculateBetaVariance in class AbstractMultipleLinearRegressionprotected double calculateErrorVariance()
Var(u) = Tr(u' Omega^-1 u)/(n-k)where n and k are the row and column dimensions of the design matrix X.
calculateErrorVariance in class AbstractMultipleLinearRegression
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||