statsmodels / statsmodels

Statsmodels: statistical modeling and econometrics in Python
http://www.statsmodels.org/devel/
BSD 3-Clause "New" or "Revised" License
9.98k stars 2.87k forks source link

ENH: score- LM-test under misspecified alternative #8288

Open josef-pkt opened 2 years ago

josef-pkt commented 2 years ago

related to #2041 I need to look at the "misspecified alternative" case again. I'm not sure the current score test works this way for the "vectorized" version (not joint test of variable addition)

main old reference is Bera and Yoon

recent article, there are a few more but I have not looked at them

extension to nonlinear hypothesis tests in GMM

Bera, Anil, Gabriel Montes-Rojas, Walter Sosa-Escudero, and Javier Alejo. 2021. “Tests for Nonlinear Restrictions under Misspecified Alternatives with an Application to Testing Rational Expectation Hypotheses.” The Econometrics Journal 24 (1): 41–57. https://doi.org/10.1093/ectj/utaa010.

my current context #8286 Jarque-Bera joint normality (skew plus kurtosis) test versus separate skew and kurtosis tests

Bera, Anil K., and Gamini Premaratne. 2001. “Adjusting the Tests for Skewness and Kurtosis for Distributional Misspecifications.” SSRN Scholarly Paper 304465. Rochester, NY: Social Science Research Network. https://doi.org/10.2139/ssrn.304465.

It's only a working paper. I didn't see it referenced in the kurtosis literature, a only partially looked at literature for skewness/symmetry tests. update I found the published version Premaratne, Gamini, and Anil K. Bera. 2017. “Adjusting the Tests for Skewness and Kurtosis for Distributional Misspecifications.” Communications in Statistics - Simulation and Computation 46 (5): 3599–3613. https://doi.org/10.1080/03610918.2014.988254. and related, an older article for skewness using higher moments for nonnormality Godfrey, L. G., and C. D. Orme. 1991. “Testing for Skewness of Regression Disturbances.” Economics Letters 37 (1): 31–34. https://doi.org/10.1016/0165-1765(91)90238-G.

There a many more traditional examples for Bera/Yoon robust testing, e.g. i.i.d. versus correlation and/or heteroscedasticity

The point here: Check and implement the generic version in score_test and the cm-tests (conditional moment tests).

One implementation problem is that the references partial out the extra effects, while I work mostly with the joint matrix versions. i.e. the question is which matrices are inverted to get the cov_params of the moment conditions. I'm not sure the current version of the score_test does this because it looked like it tests the test separately for each variable addition. (Maybe variable addition in OLS doesn't have the misspecified alternative problem. ???)

also related: In (almost sure independence) screening, we add several variables at once to capture multicolinearities.

update

partially reading Godfrey-Orme 2001 again AFAIU based on the quick read, we need a one-step estimate to capture a possible parameter change from other restrictions that might also not hold (misspecified alternative) when evaluating the test for the parameter under consideration. (I didn't look at Godfrey Orme 1996 again, both first added to Zotero in 2013)

It seems to be essentially the same as C(alpha) tests #2052, 2052 has link to #2050 (one-step estimators)

Godfrey, Leslie G., and Chris D. Orme. 1996. “On the Behavior of Conditional Moment Tests in the Presence of Unconsidered Local Alternatives.” International Economic Review 37 (2): 263–81. https://doi.org/10.2307/2527323.

Godfrey, L.G., and C.D. Orme. 2001. “On Improving the Robustness and Reliability of Rao’s Score Test.” Journal of Statistical Planning and Inference 97 (1): 153–76. https://doi.org/10.1016/S0378-3758(00)00351-7.

Godfrey-Orme 2001 p.159 "The use of as the first-stage estimator to derive robust tests is acceptable when, as in this paper, only local departures from the null are considered in asymptotic analyses."

They refer to other articles for case when the other parameter restriction might deviate by a large, O(1), amount. Then sqrt(n) local alternative is not appropriate. (This seems to be allowed in C(alpha) tests.)

Also, they include the m-estimator sandwich form of the robust score test e.g. equ. (3.11)

josef-pkt commented 2 years ago

One more:

L. G. Godfrey & M. R. Veall (2000) Alternative approaches to testing by variable addition, Econometric Reviews, 19:2, 241-261, DOI: 10.1080/07474930008800470 https://doi.org/10.1080/07474930008800470

It looks like variable addition robust to misspecified alternative is just wald test on full model, i.e. auxiliary model with added variables, in their example for omitted variable (RESET test), structural break (Chow test), and autocorrelation (LM test).

(one-step in linear model is fully unrestricted estimate)

josef-pkt commented 2 years ago

This is a possible target for 0.15 #8217

e.g. #5564

josef-pkt commented 2 years ago

puzzling related Premaratne, Bera inhttps://github.com/statsmodels/statsmodels/issues/8286#issuecomment-1135958111 no skewness robust to misspecified no excess kurtosis.

In there derivation of score test, they don't use directly something like Bera, Yoon. They just use the robust cov_type for score_test (referencing White for the general case, which I think is the same as what I implemented based on Boos)

aside: for kurtosis they don't actually use the score_test, To get an additional (b1 or m3) term they use the variance of the kurtosis estimate directly, not the one implied by the pearson system alternative to normality.