public class HarveyGodfrey extends HypothesisTest
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.
| Modifier and Type | Field and Description |
|---|---|
protected int |
n
number of observations
|
protected Residuals |
residuals |
k, N, pValue, testStatistics| Constructor and Description |
|---|
HarveyGodfrey(Residuals residuals)
Perform the Harvey-Godfrey test to test for heteroskedasticity in a linear regression model.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlternativeHypothesis()
Get a description of the alternative hypothesis.
|
protected OLSRegression |
getAuxiliaryOLSRegression(Vector y,
Residuals residuals)
the auxiliary regression
|
OLSRegression |
getAuxiliaryRegression() |
java.lang.String |
getNullHypothesis()
Get a description of the null hypothesis.
|
protected ChiSquareDistribution |
getX2() |
double |
pValue()
Get the p-value.
|
double |
statistics()
Get the test statistics.
|
isNullRejected, oneSidedPvalueprotected final Residuals residuals
protected final int n
public HarveyGodfrey(Residuals residuals)
residuals - the Residuals object from an OLS regressionpublic OLSRegression getAuxiliaryRegression()
public java.lang.String getNullHypothesis()
HypothesisTestgetNullHypothesis in class HypothesisTestpublic java.lang.String getAlternativeHypothesis()
HypothesisTestgetAlternativeHypothesis in class HypothesisTestpublic double statistics()
HypothesisTeststatistics in class HypothesisTestpublic double pValue()
HypothesisTestpValue in class HypothesisTestprotected ChiSquareDistribution getX2()
protected OLSRegression getAuxiliaryOLSRegression(Vector y, Residuals residuals)