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
I just remembered this and had to search for it.
good to implement, AFAIR. (I thought I remember something like this for Binomial/Bernoulli, but maybe not.)
It smooths the probability integral transform to get something that looks similar to continuous data case.
The usual is randomization.
Czado, Claudia, Tilmann Gneiting, and Leonhard Held. 2009. “Predictive Model Assessment for Count Data.” Biometrics 65 (4): 1254–61. doi:10.1111/j.1541-0420.2009.01191.x.
edit
issue #2027 has reference issue for Czado
probabilistic forecasting article is for continuous distributions
The Czado et al and similar articles are for predictive distributions and not just for mean prediction.
i.e. we want to estimate a probability distribution that we can use for prediction, and not just get consistent estimates for mean parameters as in QMLE.
adding this here, see also #3887 which includes ideas for comparing different count models
The following is from a trying out notebook, based on zero-inflation PR ex_generalizedpoisson_nbp.ipynb
dataset is randhie
we can get aggregate predicted probabilities now with predict
Besides plotting the histogram, we can also compute some distance measures. Here I'm using proportions or probabilities and not counts as in chisquare test.
We still need some helper functions for binning or combining of small or zero count cells. Here I just truncate.
according to this gp1 would be the best fit in aggregated average distribution. Visually in histogram there is little difference between gp and nb, but poisson and zip are way off.
gp1 is actually gp(p=1.2) where I did a rough (eyeballing the histogram) search for p.
Holling, Heinz, Walailuck Bohning, and Dankmar Bohning. 2015. “The Covariate-Adjusted Frequency Plot for the Rasch Poisson Counts Model.” Thailand Statistician 13 (1): 67–78.
This includes a random effects Poisson model, but it is not clear from the article, whether or how they include the random effects in the predicted frequencies/probabilities.
maybe they only used fixed effects for the plots.
aside: their 2016 article has a discussion on exposure and n_trials in Poisson and Binomial count models.
I just checked: PoissonResults predict_prob, and predict function in new count models like GPP, NBP include offset and exposure
both in the same way as for predict function.
I didn't check the exposure case for this plot, but it looks like offset and exposure are automatically included.
Activity
josef-pkt commentedon Apr 28, 2016
I just remembered this and had to search for it.
good to implement, AFAIR. (I thought I remember something like this for Binomial/Bernoulli, but maybe not.)
It smooths the probability integral transform to get something that looks similar to continuous data case.
The usual is randomization.
Czado, Claudia, Tilmann Gneiting, and Leonhard Held. 2009. “Predictive Model Assessment for Count Data.” Biometrics 65 (4): 1254–61. doi:10.1111/j.1541-0420.2009.01191.x.
edit
issue #2027 has reference issue for Czado
probabilistic forecasting article is for continuous distributions
josef-pkt commentedon Apr 28, 2016
The Czado et al and similar articles are for predictive distributions and not just for mean prediction.
i.e. we want to estimate a probability distribution that we can use for prediction, and not just get consistent estimates for mean parameters as in QMLE.
[-]diagnostic for Poisson and count data[/-][+]diagnostic, gof for Poisson and count data[/+]josef-pkt commentedon Aug 28, 2017
adding this here, see also #3887 which includes ideas for comparing different count models
The following is from a trying out notebook, based on zero-inflation PR
ex_generalizedpoisson_nbp.ipynbdataset is randhie
we can get aggregate predicted probabilities now with
predictBesides plotting the histogram, we can also compute some distance measures. Here I'm using proportions or probabilities and not counts as in chisquare test.
We still need some helper functions for binning or combining of small or zero count cells. Here I just truncate.
according to this gp1 would be the best fit in aggregated average distribution. Visually in histogram there is little difference between gp and nb, but poisson and zip are way off.
gp1 is actually gp(p=1.2) where I did a rough (eyeballing the histogram) search for p.
josef-pkt commentedon Aug 28, 2017
related:
eval_measuresfor non-continuous variables and GLM #2572josef-pkt commentedon Aug 28, 2017
bar plots using pandas (I like the look of my handmade better.)
plot of frequencies
difference between predicted and observed frequencies/probabilities
danielkurniadi commentedon Dec 30, 2019
Hi @josef-pkt , have we added any
dispersiontestfunctionality similar to that ofAERorDHarmain R?josef-pkt commentedon Dec 30, 2019
https://github.com/statsmodels/statsmodels/blob/master/statsmodels/discrete/_diagnostics_count.py
Mainly for poisson, many versions without clear preferences or recommendations AFAIR
(I’m on a skiing trip and can provide more info in the next few days.)
josef-pkt commentedon Dec 30, 2019
Correction I didn't remember correctly.
That module has mainly zero inflation tests. I don’t remember where the excess dispersion tests are
josef-pkt commentedon Dec 30, 2019
statsmodels/statsmodels/stats/_diagnostic_other.py
Line 658 in 1212616
danielkurniadi commentedon Dec 30, 2019
Alright will take a look. Enjoy the skiing trip. Merry XMas and Happy New year btw.
josef-pkt commentedon Feb 26, 2020
https://www.rdocumentation.org/packages/AER/versions/1.2-9/topics/dispersiontest
maybe a source for unit tests.
josef-pkt commentedon Apr 21, 2021
I don't find an issue with this reference
frequency plot similar to what I have in notebook and
prob_plotsinstatsmodels.discrete._diagnostics_countHolling, Heinz, Walailuck Böhning, Dankmar Böhning, and Anton K Formann. 2016. “The Covariate-Adjusted Frequency Plot.” Statistical Methods in Medical Research 25 (2): 902–16. https://doi.org/10.1177/0962280212473386.
Holling, Heinz, Walailuck Bohning, and Dankmar Bohning. 2015. “The Covariate-Adjusted Frequency Plot for the Rasch Poisson Counts Model.” Thailand Statistician 13 (1): 67–78.
This includes a random effects Poisson model, but it is not clear from the article, whether or how they include the random effects in the predicted frequencies/probabilities.
maybe they only used fixed effects for the plots.
aside: their 2016 article has a discussion on exposure and n_trials in Poisson and Binomial count models.
I just checked: PoissonResults predict_prob, and predict function in new count models like GPP, NBP include offset and exposure
both in the same way as for predict function.
I didn't check the exposure case for this plot, but it looks like offset and exposure are automatically included.
danielkurniadi commentedon Apr 22, 2021
ok cool.