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
ENH: score test for zero-inflation and over/excess dispersion #7131
I wrote separate tests for zero-inflation and over dispersion in Poisson.
more general:
score test for other count models, distributions, NB, Binomial
joint test for both, or test for one that is robust the the other
Deng, Dianliang, and Sudhir R. Paul. 2005. “Score Tests for Zero-Inflation and over-Dispersion in Generalized Linear Models.” Statistica Sinica 15 (1): 257–76.
(reference found through penalization article, #7128 (comment) )
aside: overdispersed likelihood looks like a polynomial expansion around the original, but only one extra term is used in the derivation of score tests.
note dispersion in Poisson is a test on variance without changing mean.
AFAIU, In ZIP, dispersion also affects mean, i.e. dispersion and mean are not separable,
related: try TIC, takeushi information criterion, to compare the different count models if we need to select one.
Note, these are full likelihood score tests, with derived analytical score and hessians
Using a CMT would be simpler, especially with OPG (similar to Gorm, Cameron, Trivedi version of Poisson overdispersion, IIRC)
This is the hessian/likelihood version of the zero inflation/deflation test checking directly the zero count, that I have already with OPG.
AFAICS, they use a sandwich form for the cov of the augmented score/moment conditions.
I think this should make a good example and test case for the general CMT version. For binned endog, we can just augment the moment conditions with more predicted probs for bins.
by the same authors, maybe related, I didn't look closely
but it says zero-inflated predictors, so maybe not related and not so interesting
Ye, Peng, Wan Tang, Jiang He, and Hua He. 2019. “A GEE-Type Approach to Untangle Structural and Random Zeros in Predictors.” Statistical Methods in Medical Research 28 (12): 3683–96. https://doi.org/10.1177/0962280218812228.
test_poisson_zeroinflation has the cross-derivative and should be the same as He et al. He et all use the sandwich cov, AFAICS I have standard, correctly specified hessian as cov
The function hardcodes poisson prob and derivative at zero , this should be made more generic.
This doesn't reuse a CMT function.
Note,
He et al derive the test as a CMT, no excess zero is an additional moment condition (without additional exog_infl)
Jansakul and Hinde derive the score_test against the ZIP model under the assumption that Poisson is correctly specified.
So, maybe there are differences between the two tests, besides sandwich form of cov.
test_chisquare_prob is the opg version for binned chisquare test
In some cases computing EIM is possible for score_tests, even when the general expressions are too difficult. When we use a generic function, then we would only have OIM/Hessian.
ZIP versus GPP or NBP excess dispersion score tests
Fisher information matrix, EIM, at the zip null is the same whether the alternative is GPP or NBP. It has same form as function of mu, and under the null mu is from Poisson. So score test against both alternatives are the same.
Note, dispersion coefficient in GPP can be negative, so null assumptions a=0 is in the interior of the GPP parameter space but on the boundary/limit of the NBP parameter space.
Weights in the different score equation for zero inflation or excess dispersion are derived from a specified alternative.
He et al (IIRC) changed weights to reduce the effect of large residuals in some versions, arguing that they have a large effect on the specification test (similar to outliers)
more general,
I guess this is the question of optimal instruments in the extra moment conditions where instruments work as weight functions, e.g. using var in squared resid_pearson.
If we don't want to rely on this weighting, then we could just use some default weights e.g. uniform.
e.g. zero-inflated probability instead of some variance or alternative specific weighted version of it.
We would loose efficiency against specific alternatives but might gain robustness to "over-weighted" observations.
example Binomial/Bernoulli where weights (inverse variance) is very large for probs close to 0 or 1.
Activity
josef-pkt commentedon Oct 31, 2020
aside: overdispersed likelihood looks like a polynomial expansion around the original, but only one extra term is used in the derivation of score tests.
note dispersion in Poisson is a test on variance without changing mean.
AFAIU, In ZIP, dispersion also affects mean, i.e. dispersion and mean are not separable,
related: try TIC, takeushi information criterion, to compare the different count models if we need to select one.
josef-pkt commentedon Nov 1, 2020
over dispersion in ZI modes
might be interesting, seems to work for various power variance functions, maybe also GPP.
extension of Dean over dispersion test in Poisson to ZI
Yang, Zhao, James W. Hardin, and Cheryl L. Addy. 2010. “Some Remarks on Testing Overdispersion in Zero-Inflated Poisson and Binomial Regression Models.” Communications in Statistics - Theory and Methods 39 (15): 2743–52. https://doi.org/10.1080/03610920903177397.
Note, these are full likelihood score tests, with derived analytical score and hessians
Using a CMT would be simpler, especially with OPG (similar to Gorm, Cameron, Trivedi version of Poisson overdispersion, IIRC)
josef-pkt commentedon Nov 1, 2020
BTW: we don't have any ZI or dispersed alternatives to Binomial count, like Beta-Binomial or ZIB
josef-pkt commentedon Nov 1, 2020
nice new articles
This is the hessian/likelihood version of the zero inflation/deflation test checking directly the zero count, that I have already with OPG.
AFAICS, they use a sandwich form for the cov of the augmented score/moment conditions.
I think this should make a good example and test case for the general CMT version. For binned endog, we can just augment the moment conditions with more predicted probs for bins.
He, Hua, Hui Zhang, Peng Ye, and Wan Tang. 2019. “A Test of Inflated Zeros for Poisson Regression Models.” Statistical Methods in Medical Research 28 (4): 1157–69. https://doi.org/10.1177/0962280217749991.
Ye, Peng, Yi Tang, Liuquan Sun, Wan Tang, and Hua He. n.d. “Testing Inflated Zeros in Binomial Regression Models.” Biometrical Journal n/a (n/a). Accessed October 31, 2020. https://doi.org/10.1002/bimj.202000028.
Tang, Yi, and Wan Tang. 2018. “Testing Modified Zeros for Poisson Regression Models:” Statistical Methods in Medical Research, September. https://doi.org/10.1177/0962280218796253.
by the same authors, maybe related, I didn't look closely
but it says zero-inflated predictors, so maybe not related and not so interesting
Ye, Peng, Wan Tang, Jiang He, and Hua He. 2019. “A GEE-Type Approach to Untangle Structural and Random Zeros in Predictors.” Statistical Methods in Medical Research 28 (12): 3683–96. https://doi.org/10.1177/0962280218812228.
josef-pkt commentedon Nov 17, 2020
correction to previous comment
test_poisson_zeroinflationhas the cross-derivative and should be the same as He et al. He et all use the sandwich cov, AFAICS I have standard, correctly specified hessian as covThe function hardcodes poisson prob and derivative at zero , this should be made more generic.
This doesn't reuse a CMT function.
Note,
He et al derive the test as a CMT, no excess zero is an additional moment condition (without additional exog_infl)
Jansakul and Hinde derive the score_test against the ZIP model under the assumption that Poisson is correctly specified.
So, maybe there are differences between the two tests, besides sandwich form of cov.
test_chisquare_probis the opg version for binned chisquare testjosef-pkt commentedon Nov 18, 2020
EIM versys OIM
In some cases computing EIM is possible for score_tests, even when the general expressions are too difficult. When we use a generic function, then we would only have OIM/Hessian.
ZIP versus GPP or NBP excess dispersion score tests
Zamani, Hossein, and Noriszura Ismail. 2013. “Score Test for Testing Zero-Inflated Poisson Regression against Zero-Inflated Generalized Poisson Alternatives.” Journal of Applied Statistics 40 (9): 2056–68. https://doi.org/10.1080/02664763.2013.804904.
Fisher information matrix, EIM, at the zip null is the same whether the alternative is GPP or NBP. It has same form as function of mu, and under the null mu is from Poisson. So score test against both alternatives are the same.
Note, dispersion coefficient in GPP can be negative, so null assumptions
a=0is in the interior of the GPP parameter space but on the boundary/limit of the NBP parameter space.josef-pkt commentedon Nov 20, 2020
just a thought
Weights in the different score equation for zero inflation or excess dispersion are derived from a specified alternative.
He et al (IIRC) changed weights to reduce the effect of large residuals in some versions, arguing that they have a large effect on the specification test (similar to outliers)
more general,
I guess this is the question of optimal instruments in the extra moment conditions where instruments work as weight functions, e.g. using var in squared resid_pearson.
If we don't want to rely on this weighting, then we could just use some default weights e.g. uniform.
e.g. zero-inflated probability instead of some variance or alternative specific weighted version of it.
We would loose efficiency against specific alternatives but might gain robustness to "over-weighted" observations.
example Binomial/Bernoulli where weights (inverse variance) is very large for probs close to 0 or 1.
josef-pkt commentedon Nov 20, 2020
small sample correction
Gurmu add small sample (bias) correction to score test for dispersion in zero-truncated Poisson, and mentions that Dean and Lawless did the same.
I don't remember ever having paid attention to this.
i.e. we might have excess dispersion tests that depend on
maybe there is a better structure to my list of excess dispersion test