Class Heteroskedasticity
- java.lang.Object
-
- dev.nm.stat.test.HypothesisTest
-
- dev.nm.stat.test.regression.linear.heteroskedasticity.Heteroskedasticity
-
- Direct Known Subclasses:
BreuschPagan
,Glejser
,HarveyGodfrey
,White
public abstract class Heteroskedasticity extends HypothesisTest
A heteroskedasticity test tests, for a linear regression model, whether the estimated variance of the residuals from a regression is dependent on the values of the independent variables (regressors). The test statistic is computed by regressing the transformed residuals from the original regression against the original regressors (plus intercept). Different implementations of heteroskedasticity tests have different ways to do the transformation. The test distribution is a Chi-squared distribution.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
N
the number of observationsprotected LMResiduals
residuals
-
Constructor Summary
Constructors Constructor Description Heteroskedasticity(LMResiduals residuals)
Construct a heteroskedasticity test.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getAlternativeHypothesis()
Get the description of the alternative hypothesis.protected OLSRegression
getAuxiliaryOLSRegression(Vector y, LMResiduals residuals)
Get the auxiliary regression.protected abstract OLSRegression
getAuxiliaryRegression()
Define the transformation of residuals.String
getNullHypothesis()
Get a description of the null hypothesis.protected ChiSquareDistribution
getX2()
Get the Chi-squared distribution.double
pValue()
Get the p-value for the test statistics.double
statistics()
Get the test statistics.-
Methods inherited from class dev.nm.stat.test.HypothesisTest
isNullRejected, nGroups, nObs, oneSidedPvalue
-
-
-
-
Field Detail
-
N
protected final int N
the number of observations
-
residuals
protected final LMResiduals residuals
-
-
Constructor Detail
-
Heteroskedasticity
public Heteroskedasticity(LMResiduals residuals)
Construct a heteroskedasticity test.- Parameters:
residuals
- the residuals from a linear regression result
-
-
Method Detail
-
getAuxiliaryRegression
protected abstract OLSRegression getAuxiliaryRegression()
Define the transformation of residuals.- Returns:
- an auxiliary regression
-
getNullHypothesis
public String getNullHypothesis()
Description copied from class:HypothesisTest
Get a description of the null hypothesis.- Specified by:
getNullHypothesis
in classHypothesisTest
- Returns:
- the null hypothesis description
- See Also:
- Wikipedia: Null hypothesis
-
getAlternativeHypothesis
public String getAlternativeHypothesis()
Description copied from class:HypothesisTest
Get the description of the alternative hypothesis.- Specified by:
getAlternativeHypothesis
in classHypothesisTest
- Returns:
- the alternative hypothesis description
- See Also:
- Wikipedia: Alternative hypothesis
-
statistics
public double statistics()
Description copied from class:HypothesisTest
Get the test statistics.- Specified by:
statistics
in classHypothesisTest
- Returns:
- the test statistics
- See Also:
- Wikipedia: Test statistic
-
pValue
public double pValue()
Description copied from class:HypothesisTest
Get the p-value for the test statistics.- Specified by:
pValue
in classHypothesisTest
- Returns:
- the p-value
- See Also:
- Wikipedia: P-value
-
getX2
protected ChiSquareDistribution getX2()
Get the Chi-squared distribution.- Returns:
- the Chi-squared distribution
-
getAuxiliaryOLSRegression
protected OLSRegression getAuxiliaryOLSRegression(Vector y, LMResiduals residuals)
Get the auxiliary regression.- Parameters:
y
- the observationsresiduals
- the residuals from a linear regression result- Returns:
- the auxiliary regression
-
-