|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.numericalmethod.suanshu.stats.test.HypothesisTest
com.numericalmethod.suanshu.stats.test.regression.linear.heteroskedasticity.HarveyGodfrey
public class HarveyGodfrey
The Harvey-Godfrey test is used to test for heteroskedasticity in a linear regression model. It tests whether the estimated variance of the residuals from a regression are dependent on the values of the independent variables (regressors).
The Harvey-Godfrey test tests for conditional heteroskedasticity. The test statistics is computed by regressing log of squared residuals from the original regression against the original regressors (plus intercept). The test is a chi-squared test: the test statistic distribution is nχ2 with k degrees of freedom.
| Field Summary | |
|---|---|
protected int |
n
number of observations |
protected Residuals |
residuals
|
| Fields inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest |
|---|
k, N, pValue, testStatistics |
| Constructor Summary | |
|---|---|
HarveyGodfrey(Residuals residuals)
Perform the Harvey-Godfrey test to test for heteroskedasticity in a linear regression model. |
|
| Method Summary | |
|---|---|
java.lang.String |
alternativeHypothesis()
Get a description of the alternative hypothesis. |
protected OlsRegression |
auxiliaryOlsRegression(Vector y,
Residuals residuals)
the auxiliary regression |
OlsRegression |
getAuxiliaryRegression()
|
protected ChiSquareDistribution |
getX2()
|
java.lang.String |
nullHypothesis()
Get a description of the null hypothesis. |
double |
pValue()
Get the p-value. |
double |
testStatistics()
Get the test statistics. |
| Methods inherited from class com.numericalmethod.suanshu.stats.test.HypothesisTest |
|---|
oneSidedPvalue, rejectNull |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Residuals residuals
protected final int n
| Constructor Detail |
|---|
public HarveyGodfrey(Residuals residuals)
residuals - the Residuals object from an OLS regression| Method Detail |
|---|
public OlsRegression getAuxiliaryRegression()
public java.lang.String nullHypothesis()
HypothesisTest
nullHypothesis in class HypothesisTestpublic java.lang.String alternativeHypothesis()
HypothesisTest
alternativeHypothesis in class HypothesisTestpublic double testStatistics()
HypothesisTest
testStatistics in class HypothesisTestpublic double pValue()
HypothesisTest
pValue in class HypothesisTestprotected ChiSquareDistribution getX2()
protected OlsRegression auxiliaryOlsRegression(Vector y,
Residuals residuals)
|
SuanShu, a Java numerical and statistical library | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||