public class BreuschPagan extends HypothesisTest
The Breusch–Pagan test tests for conditional heteroskedasticity. The test statistics is computed by regressing 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. If the Breush–Pagan test shows that there is conditional heteroscedasticity, it can be corrected by using the Hansen method, using robust standard errors, or re-thinking the regression equation.
The R equivalent function is bptest.
| Modifier and Type | Field and Description |
|---|---|
protected int |
n
number of observations
|
protected Residuals |
residuals |
k, N, pValue, testStatistics| Constructor and Description |
|---|
BreuschPagan(Residuals residuals,
boolean studentized)
Perform the Breusch-Pagan 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 BreuschPagan(Residuals residuals, boolean studentized)
residuals - the Residuals object from an OLS regressionstudentized - true if to use the Koenker's studentized version of the test statisticpublic OLSRegression getAuxiliaryRegression()
public double statistics()
HypothesisTestpublic java.lang.String getNullHypothesis()
HypothesisTestgetNullHypothesis in class HypothesisTestpublic java.lang.String getAlternativeHypothesis()
HypothesisTestgetAlternativeHypothesis in class HypothesisTestpublic double pValue()
HypothesisTestpValue in class HypothesisTestprotected ChiSquareDistribution getX2()
protected OLSRegression getAuxiliaryOLSRegression(Vector y, Residuals residuals)