Repository navigation
Description
there is a PR #3807 but no issue yet (AFAICS)
- docstring: I checked and fixed the class docstrings, but some method docstrings are still incomplete and I haven't checked them yet
e.g. NegativeBinomial.fit doesn't have full list of arguments in code, but then uses inherited generic__doc__(needs templating) - transparams: currently unused, untested, buggy in GPP and NBP, and turned off by default see BUG: transparams and start_params not consistent #3918
- init_kwds and llnull:
- NB-P and GB-P don't have the
pparameters in llnull AFAICS - two part models like ZIP need the second exog in creating the null model
- NB-P and GB-P don't have the
- llnull: more robust estimation, is already a separate issue -> fixed, enhanced in ENH/REF/BUG Discrete models llnull improvements #3921
- margins
- one part models look fine, NB and NB-P is fixed and unit tested (for p=2)
- truncated models: I guess we need extra computation for the mean and derivatives (i.e. it is not just exp(x b))
- two part models like ZIP and hurdle: I guess this should raise NotImplementedError for now.
We have two exog, and several types of mean or conditional mean prediction. This will need larger enhancements.
-> exception for ZI added in ENH: zero-inflated count models #3908, get_margeff() didn't raise for ZINB but I don't know what the result means.
- robustness to boundary cases, e.g. ZI-prob goes to zero.
maybe not much what we can do, but we could provide tools to identify problematic cases, one example score test based on simpler model - start_params
will need review and refactoring to see which models will provide good initial estimates (problem in ZIGPP and ZINBP)
enhancements
- goodness-of-fit measures, tests and graphics
-> partially added in ENH: zero-inflated count models #3908 as private functions - generalize to allow more submodels in ZI, Hurdle
- score test for zero inflation and similar Jansakul and Hinde (2002) us identity/linear link for inflation model to allow that zero-inflation probability=0. (There are several other score test articles for various comparisons but I only skimmed time a few years ago.)
-> partially added in ENH: zero-inflated count models #3908 as private function - Vuong test, see ENH diagnostic/specification Vuong test for non-nested hypothesis #3897
- prediction standard errors and confidence intervals, for which prediction and what kind of confidence intervals. - see also ENH/Design GLM pattern, families, links, for non-LEF distributions #3915 problem with reusing loglikeobs, score_obs for predicted probabilties
- get_distribution:
- add new predict options to old count models.
question:
Can we use a chisquare test for testing predicted versus empirical probabilities? E.g. corresponding to the histogram plot of aggregated counts or the corresponding cumulative probabilities.
References
Jansakul, N., and J. P. Hinde. 2002. “Score Tests for Zero-Inflated Poisson Models.” Computational Statistics & Data Analysis 40 (1): 75–96. doi:10.1016/S0167-9473(01)00104-9.
Jansakul, N., and John P. Hinde. 2008. “Score Tests for Extra-Zero Models in Zero-Inflated Negative Binomial Models.” Communications in Statistics - Simulation and Computation 38 (1): 92–108. doi:10.1080/03610910802421632.
Ridout, Martin, John Hinde, and Clarice G. B. DeméAtrio. 2001. “A Score Test for Testing a Zero-Inflated Poisson Regression Model Against Zero-Inflated Negative Binomial Alternatives.” Biometrics 57 (1): 219–23. doi:10.1111/j.0006-341X.2001.00219.x.
Activity
josef-pkt commentedon Aug 27, 2017
a partial generic idea:
The new predict functions are just nonlinear functions of the parameters. So we should be able to use the nonlinear wald/t test version to compute inference for it, i.e. standard errors and confidence intervals with delta method or confidence intervals with endpoint transformation if there is a monotonic mapping from linear predictor to the desired prediction.
(i.e. predict_nl and test_nl equivalents)
josef-pkt commentedon Aug 27, 2017
score/diagnostic tests for dispersion:
NBP and GPP assume different functions for the relationship between var and mean. In analogue to overdispersion tests, we could just construct specification tests based on auxiliary regression.
A possible problem is that it might be difficult to identify or distinguish the patterns of dispersion. For example in the test case for the randhie dataset the resid**2 vs. endog or mean doesn't have a clear pattern in the plot. (i.e. variance does not contain enough information to distinguish distributions that are close to each other.)
related: One of the differences between GPP and NBP is in how heavy or thick the tails are. There might be some information when looking at extreme observations or outliers.
(I have no idea how sensitive those models are to outliers.)
a bit related https://stackoverflow.com/questions/45901898/how-to-specify-tail-value-of-a-poisson-distribution-in-scipy-stats heavy tail alternatives to Poisson. (I never checked in details the logseries distribution in scipy.)
josef-pkt commentedon Nov 18, 2020
I don't find docs for the parameterization of GPP
we need some formulas in the docstrings
I don't find an issue or PR with the references for GPP and I don't find any reference to GPP parameterization in docstrings.
reference for
Pversion of GP isZamani, Hossein, and Noriszura Ismail. "Functional form for the generalized Poisson regression model." Communications in Statistics-Theory and Methods 41, no. 20 (2012): 3666-3675.
which also has the reference to the NBP version
Greene, W. (2008). Functional forms for the negative binomial model for count data. Econ. Lett. 99:585–590.
aside GPP(p=1) has a different parameterization of dispersion coefficient from the standard GP1
GPP:
E(y) = mu
Var(y) = (1 + a * mu^(p-1) )^2
josef-pkt commentedon Nov 18, 2020
predict
which == "prob"hardcodes the max count, this should be an option.(I would like to get something larger)
Poisson doesn't have a predict 'prob' option
josef-pkt commentedon Nov 19, 2020
for zigpp
looks like a good paper with overview, including GP-P version
Kamalja, Kirtee K, and Yogita S Wagh. 2018. “Estimation in Zero-Inflated Generalized Poisson Distribution.” Journal of Data Science 16 (1): 183–206.
just very brief skimming,
published after our new count models PR. they don't mention what software they use for simulations, AFAICS
they have older articles on GP, using matlab
josef-pkt commentedon Dec 1, 2020
VGAM has NBP and other variants of negbin
Yee, Thomas W. 2020. “The VGAM Package for Negative Binomial Regression.” Australian & New Zealand Journal of Statistics 62 (1): 116–31. https://doi.org/10.1111/anzs.12283.