You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SUMM/ENH: LR like test for misspecified models, sum of chisquare distribution #3363
(I ran into this now 3,4 times in the last months for different applications. I might have some experiments from years ago.)
For QMLE or estimating equations or GMM under mis- or incompletely specified assumptions (no "true" likelihood)
Wald test with robust sandwich covariance has still standard chisquare distribution.
LR or anova type tests have asymptotically usually the distribution of a linear combination of chisquare distributions.
Although LR/anova type tests have non-standard distribution (and is not pivotal), it is still used in several areas of statistics. I don't remember having seen an actual application in econometrics.
(outlier) robust estimator: I don't remember reference
GEE: anova or lr test, see reference Fan and Zhang below
Fan, Chunpeng, and Donghui Zhang. 2014. “Robust Small Sample Inference for Generalised Estimating Equations: An Application of the Anova-Type Test.” Australian & New Zealand Journal of Statistics 56 (3): 237–55. doi:10.1111/anzs.12081.
AFAIR, the outlier robust literature referred to articles with the full linear combination of chisquare distribution, e.g. via characteristic function.
The Anova papers for contingency tables use 1st or 2nd order approximation.
The GEE article uses a 2nd order approximation (based on partial skimming of article)
Implementation
The weights in the linear combination of chisquare random variables are the eigenvalues of a data dependent matrix. This matrix is application specific and not always explicitly given in some articles (especially in econometrics when I looked at it in the past).
First order approximation in the special case of contingency tables can avoid computing the full matrix for the eigenvalues.
So we need a function just for the distribution, with p-values based on different degrees of approximation.
We also need the model specific code for the matrix for which the eigenvalues are computed.
We can also use special case functions in cases where there is a model specific shortcut that avoids the full matrix.
R package survey has a function to compute cdf values of weighted sum of chi2 random variables using several different methods and approximations, including explicit integration of characteristic function pchisqsum Distribution of quadratic forms
brief description of it in appendix p. 223 of
Lumley, Thomas. 2010. Complex Surveys: A Guide to Analysis Using R. Wiley Series in Survey Methodology. Hoboken, N.J: John Wiley.
This should be good for unit tests and to collect various experimental functions that I wrote over time.
Theorem 1 is for linear regression and has the general expression for the weights in the sum of chisquare, i.e. matrix for which eigenvalues are computed.
Reference to Fuller's sampling statistics book.
article argues in favor of LR test for quasi-likelihood models, using Rao-Scott approximation or similar
Based on their comments, it sounds like it requires an i.i.d. assumption. However, that is not included in the assumptions for the theorem, AFAICS.
Theorem 3.3 has the asymptotic distribution, weighted chisquare or normal.
It uses general form for two MLE with hessian and crossproduct of score_obs.
(I never had read that part of the article)
THEOREM 7.2 handles the nested case. the distribution is weighted sum of chisquare. it applies whether model is correctly specified or not.
currently we only use Vuong for non-nested case, e.g. Poisson
There are several recent articles that adjust Vuong LR test so the limit is normal is in the strictly non-nested, non-overlapping case.
article looks good based on skimming, clear formulas to implement
doesn't compare with other approximation methods besides first and second order/moment approximation
a draft version, I'm not sure in which module it should go
Based on Monte Carlo results for covariance structure models, it looks like methods 1 and 2 are pretty good with estimated weights. Fancier methods are more accurate with fixed, known weights but not necessarily with estimated, noisy weights.
from scipy import stats
def distr_sumchi2(mat, method=1):
"""approximate distribution for sum of chisquare random variables
Parameters
----------
mat : array_like
2 dimensional square matrix.
The weights are given by the eigenvalues of mat.
method : int or string
approximation method for the distribution
currently only 2 methods are available
- 1 : scaled chisquare distribution with matching mean
- 2 : scaled chisquare distribution with adjusted degrees of
freedom to match mean and variance.
Returns
-------
distr : scipy distribution instance
This returns a frozen distribution with adjusted scale and
df. Distribution methods like "sf" are available.
Notes
-----
If eigenvalues are available, then they can be provided in a diagnonal
matrix, `distr_sumchi2(np.diag(evals))`.
References
----------
Yuan and Bentler 2010
"""
mat = np.asarray(mat)
k, k1 = mat.shape
if k1 != k:
raise ValueError("The matrix must be square")
s1 = np.trace(mat) / k
if method == 1:
distr = stats.chi2(k, scale=s1)
elif method == 2:
s2 = np.trace(mat @ mat) / k
df = s1**2 / s2
distr = stats.chi2(df, scale=s2 / s1)
else:
raise ValueError("method not available")
return distr
a pretty clear paper, useful for general implementation in terms of hessian H and cov(score_obs) J
related: His theorem has asymptotic equivalence of LR, score and wald test when the latter two use the inverse hessian nonrobust cov_params instead of the sandwich form HC.
Kent section for has sandwich wald and sandwich score tests.
aside, Kent doesn't call them Wald and score tests.
Note, Kent and most similar references assume iid observations with misspecified likelihood. However, AFAICS the asymptotic arguments should go through in analogy to heteroscedasticity, cluster and HAC robustness for cov(score)
one possible application:
We have LR-null in LikelihoodModelResults which could use an approximate sum of chi2 pvalue as alternative.
(or we switch to wald null in summary as Stata does.)
Thanks, I found it a few days ago. I was also trying to look at Gong and Samaniego (1981) which they cite.
The setup is a bit different and I decided not to go there for now.
The problem is mainly of including nuisance parameters that are not estimated by MLE. AFAICS the specified, non-nuisance part assumes correctly specified likelihood.
(it reminded me a bit on the two stage estimation problem, Murphy/Topel, but I haven't looked at that in a long time.
Kent and related (and takeuchi information criteria) are for the standard misspecified likelihood case, i.e. we estimate a likelihood model but the true DGP is not in the model class.
Some applications are where we leave out some pieces of the likelihood function like correlation, i.e. those parts are unspecified.
Based on my partial reading of Liang and Self, they still need the cross product and moment matrix with respect to the misspecified nuisance parameters.
related to AIC with misspecified likelihood models
Nishii has LR statistic is normal distributed in proof of Theorem 2 citing Foutz and Srivastava
Based on Vuong this requires non-nested models, but I didn't see that in the article (only selective skimming)
roughly:
the sum of squares statistic under the null when the alternative is the true model is distributed as weighted sum of chisquare random variables.
p. 48 in Shieh 2005 which mentions approximation by F distribution referencing Wood.
Activity
josef-pkt commentedon Dec 3, 2017
special case in context of covariance models (e.g. #2765 and factor models)
this article compares 11 different approximations for the distribution of a LR goodness of fit statistic under non-normality
Wu, Hao. 2017. “Approximations to the Distribution of a Test Statistic in Covariance Structure Analysis: A Comprehensive Study.” British Journal of Mathematical and Statistical Psychology, October. https://doi.org/10.1111/bmsp.12123.
josef-pkt commentedon Dec 5, 2018
Wood, Simon N. 2013. “A Simple Test for Random Effects in Regression Models.” Biometrika 100 (4): 1005–10. https://doi.org/10.1093/biomet/ast038.
#3446 (comment)
josef-pkt commentedon Oct 22, 2020
(random skimming in survey literature)
R package survey has a function to compute cdf values of weighted sum of chi2 random variables using several different methods and approximations, including explicit integration of characteristic function
pchisqsumDistribution of quadratic formsbrief description of it in appendix p. 223 of
Lumley, Thomas. 2010. Complex Surveys: A Guide to Analysis Using R. Wiley Series in Survey Methodology. Hoboken, N.J: John Wiley.
This should be good for unit tests and to collect various experimental functions that I wrote over time.
josef-pkt commentedon Oct 23, 2020
another reference
Lumley, Thomas, and Alastair Scott. 2014. “Tests for Regression Models Fitted to Survey Data.” Australian & New Zealand Journal of Statistics 56 (1): 1–14. https://doi.org/10.1111/anzs.12065.
Theorem 1 is for linear regression and has the general expression for the weights in the sum of chisquare, i.e. matrix for which eigenvalues are computed.
Reference to Fuller's sampling statistics book.
article argues in favor of LR test for quasi-likelihood models, using Rao-Scott approximation or similar
Based on their comments, it sounds like it requires an i.i.d. assumption. However, that is not included in the assumptions for the theorem, AFAICS.
josef-pkt commentedon Oct 26, 2020
Vuong, Quang H. 1989. “Likelihood Ratio Tests for Model Selection and Non-Nested Hypotheses.” Econometrica 57 (2): 307–33. https://doi.org/10.2307/1912557.
Theorem 3.3 has the asymptotic distribution, weighted chisquare or normal.
It uses general form for two MLE with hessian and crossproduct of score_obs.
(I never had read that part of the article)
THEOREM 7.2 handles the nested case. the distribution is weighted sum of chisquare. it applies whether model is correctly specified or not.
currently we only use Vuong for non-nested case, e.g. Poisson
There are several recent articles that adjust Vuong LR test so the limit is normal is in the strictly non-nested, non-overlapping case.
josef-pkt commentedon Oct 26, 2020
Yuan, Ke-Hai, and Peter M. Bentler. 2010. “Two Simple Approximations to the Distributions of Quadratic Forms.” British Journal of Mathematical and Statistical Psychology 63 (2): 273–91. https://doi.org/10.1348/000711009X449771.
article looks good based on skimming, clear formulas to implement
doesn't compare with other approximation methods besides first and second order/moment approximation
this article compares more methods for SEM
Wu, Hao. 2018. “Approximations to the Distribution of a Test Statistic in Covariance Structure Analysis: A Comprehensive Study.” British Journal of Mathematical and Statistical Psychology 71 (2): 334–62. https://doi.org/10.1111/bmsp.12123.
josef-pkt commentedon Oct 29, 2020
a draft version, I'm not sure in which module it should go
Based on Monte Carlo results for covariance structure models, it looks like methods 1 and 2 are pretty good with estimated weights. Fancier methods are more accurate with fixed, known weights but not necessarily with estimated, noisy weights.
josef-pkt commentedon Oct 29, 2020
Vuong cites Kent for the nested case
Kent, John T. 1982. “Robust Properties of Likelihood Ratio Test.” Biometrika 69 (1): 19–27. https://doi.org/10.2307/2335849.
a pretty clear paper, useful for general implementation in terms of hessian H and cov(score_obs) J
related: His theorem has asymptotic equivalence of LR, score and wald test when the latter two use the inverse hessian nonrobust cov_params instead of the sandwich form HC.
Kent section for has sandwich wald and sandwich score tests.
aside, Kent doesn't call them Wald and score tests.
Note, Kent and most similar references assume iid observations with misspecified likelihood. However, AFAICS the asymptotic arguments should go through in analogy to heteroscedasticity, cluster and HAC robustness for cov(score)
josef-pkt commentedon Oct 29, 2020
one possible application:
We have LR-null in LikelihoodModelResults which could use an approximate sum of chi2 pvalue as alternative.
(or we switch to wald null in summary as Stata does.)
bashtage commentedon Oct 29, 2020
This is the paper I've always seen as a cornerstone for Psuedo-LR tests:
https://www.jstor.org/stable/2346115?seq=1
josef-pkt commentedon Oct 29, 2020
Thanks, I found it a few days ago. I was also trying to look at Gong and Samaniego (1981) which they cite.
The setup is a bit different and I decided not to go there for now.
The problem is mainly of including nuisance parameters that are not estimated by MLE. AFAICS the specified, non-nuisance part assumes correctly specified likelihood.
(it reminded me a bit on the two stage estimation problem, Murphy/Topel, but I haven't looked at that in a long time.
Kent and related (and takeuchi information criteria) are for the standard misspecified likelihood case, i.e. we estimate a likelihood model but the true DGP is not in the model class.
Some applications are where we leave out some pieces of the likelihood function like correlation, i.e. those parts are unspecified.
Based on my partial reading of Liang and Self, they still need the cross product and moment matrix with respect to the misspecified nuisance parameters.
josef-pkt commentedon Oct 30, 2020
related to AIC with misspecified likelihood models
Nishii has LR statistic is normal distributed in proof of Theorem 2 citing Foutz and Srivastava
Based on Vuong this requires non-nested models, but I didn't see that in the article (only selective skimming)
Nishii, R. 1988. “Maximum Likelihood Principle and Model Selection When the True Model Is Unspecified.” Journal of Multivariate Analysis 27 (2): 392–403. https://doi.org/10.1016/0047-259X(88)90137-6.
another one mainly on rates of IC penalty term under different nestedness, misspecification assumptions. allows for dependent variables:
Sin, Chor-Yiu, and Halbert White. 1996. “Information Criteria for Selecting Possibly Misspecified Parametric Models.” Journal of Econometrics 71 (1): 207–25. https://doi.org/10.1016/0304-4076(94)01701-8.
josef-pkt commentedon Dec 3, 2020
Vuong Theorem 3.3 has the general form of the matrix of which the eigenvalues are the weights in weighted sum of chi2
has the form B @ Ainv for stacked score_obs in B (with negative sign of first model) and Ainv is blockdiagonal diag(Afinv, Aginv)
josef-pkt commentedon Apr 23, 2021
another one minimum distance estimation with density power divergence #7412
Basu, A., A. Mandal, N. Martin, and L. Pardo. 2013. “Testing Statistical Hypotheses Based on the Density Power Divergence.” Annals of the Institute of Statistical Mathematics 65 (2): 319–48. https://doi.org/10.1007/s10463-012-0372-y.
josef-pkt commentedon Oct 29, 2024
another application: power computation
roughly:
the sum of squares statistic under the null when the alternative is the true model is distributed as weighted sum of chisquare random variables.
p. 48 in Shieh 2005 which mentions approximation by F distribution referencing Wood.
Shieh, Gwowen. 2005. “On Power and Sample Size Calculations for Wald Tests in Generalized Linear Models.” Journal of Statistical Planning and Inference 128 (1): 43–59. https://doi.org/10.1016/j.jspi.2003.09.017.
(We still don't have a usable tools function with different approximations in statsmodels.)