Lagrange Multiplier Heteroscedasticity Test by Breush-Pagan
The tests the hypothesis that the residual variance does not depend on the variables in x in the form
Math : | sigma_i = sigma * f(alpha_0 + alpha z_i) |
---|
Homoscedasticity implies that $alpha=0$
Parameters : | resid : arraylike, (nobs,)
x : array_like, (nobs, nvars)
|
---|---|
Returns : | lm : float
lm_pvalue :float :
fvalue : float
f_pvalue : float
|
Notes
Assumes x contains constant (for counting dof and calculation of R^2). In the general description of LM test, Greene mentions that this test exaggerates the significance of results in small or moderately large samples. In this case the F-statistic is preferrable.
Verification
Chisquare test statistic is exactly (<1e-13) the same result as bptest in R-stats with defaults (studentize=True).
Implementation This is calculated using the generic formula for LM test using $R^2$ (Greene, section 17.6) and not with the explicit formula (Greene, section 11.4.3).
References
http://en.wikipedia.org/wiki/Breusch%E2%80%93Pagan_test Greene 5th edition Breush, Pagan article