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
Parking this here in case someone else gets an itch. I need the estimation only right now. Shouldn't be too much more work to add analytic derivatives, Vuong test, results class, summary etc.
I just checked: IIRC, I had an example against R (package ?), but it didn't make it into the test suite.
To check GenericLikelihoodModel I added tests against R for the TModel in my last round.
pvalues in GenericLikelihoodModel are normal based
needs check: the generic default df_model is set based on the number of parameters or number of exog
(used only in summary and t_test, f_test which are not normal based). I don't know how it works in this case.
If all goes well, then print res.summary() should work in your gist.
Nice. Summary does work. Could use a few tweaks on what's available, but that's neat. Need to figure out how best to hook in inflateX to the data handling, so we get the extra param names.
Right now, extra data are not checked for being pandas objects, etc. Might need some kind of flag, or just handle it specifically in this model and not try to make the data handling stretch too much. I'm not sure yet how best to do it.
We get more of these kind of double exog. So we need to figure out a generic solution.
I was reading up again on FGLS (HetGLS in the sandbox) with one regression for mean and one for variance, (and heteroscedasticity robust cov_params on top of it for the mean regression).
The R package I looked at had two different summary, one for Poisson part and one for the Zero Inflation part.
Depends also on whether the two models are estimated jointly (one large cov_params) or separately (2 cov_params or one block diagonal cov_params).
Chad has something similar with 2 part iterative regression in one of his regime switching models.
Will have to look at Chad's work. Hurdle model may be next on my agenda. but I'm not certain we'll actually need it for current project. One regime for zeros, one for non-zero process.
@vincentarelbundock yes I'm pretty sure I looked at ZIP in pscl. But that was a while ago and I thought Kleiber and Zeileis worked more recently on it.
Need to figure out how best to hook in inflateX to the data handling, so we get the extra param names.
you can try to add keyword extra_params_names=['par1', ... ]
in the super call in __init__
there is also a self._set_extra_params_names(extra_params_names)
It fills up the list of names given what is not yet available (too short) in data.exog_names. IIRC
But I doubt I tested all combinations for setting extra param names.
Activity
josef-pkt commentedon Sep 19, 2013
that brings it much ahead of https://github.com/statsmodels/statsmodels/blob/master/statsmodels/miscmodels/count.py#L187
(no exog for extra zeros and only logit)
jseabold commentedon Sep 19, 2013
Guess I should've grep'd first.
josef-pkt commentedon Sep 19, 2013
I just checked: IIRC, I had an example against R (package ?), but it didn't make it into the test suite.
To check GenericLikelihoodModel I added tests against R for the TModel in my last round.
pvalues in GenericLikelihoodModel are normal based
needs check: the generic default
df_modelis set based on the number of parameters or number of exog(used only in summary and t_test, f_test which are not normal based). I don't know how it works in this case.
If all goes well, then
print res.summary()should work in your gist.I guess
linkshould go into__init__as in GLM.jseabold commentedon Sep 19, 2013
Nice. Summary does work. Could use a few tweaks on what's available, but that's neat. Need to figure out how best to hook in inflateX to the data handling, so we get the extra param names.
Right now, extra data are not checked for being pandas objects, etc. Might need some kind of flag, or just handle it specifically in this model and not try to make the data handling stretch too much. I'm not sure yet how best to do it.
vincentarelbundock commentedon Sep 19, 2013
This may be the R package you're thinking of:
http://cran.r-project.org/web/packages/pscl/index.html
josef-pkt commentedon Sep 19, 2013
We get more of these kind of double exog. So we need to figure out a generic solution.
I was reading up again on FGLS (HetGLS in the sandbox) with one regression for mean and one for variance, (and heteroscedasticity robust cov_params on top of it for the mean regression).
The R package I looked at had two different summary, one for Poisson part and one for the Zero Inflation part.
Depends also on whether the two models are estimated jointly (one large cov_params) or separately (2 cov_params or one block diagonal cov_params).
Chad has something similar with 2 part iterative regression in one of his regime switching models.
jseabold commentedon Sep 19, 2013
Will have to look at Chad's work. Hurdle model may be next on my agenda. but I'm not certain we'll actually need it for current project. One regime for zeros, one for non-zero process.
josef-pkt commentedon Sep 19, 2013
@vincentarelbundock yes I'm pretty sure I looked at ZIP in
pscl. But that was a while ago and I thought Kleiber and Zeileis worked more recently on it.josef-pkt commentedon Sep 19, 2013
@jseabold
you can try to add keyword
extra_params_names=['par1', ... ]in the super call in
__init__there is also a
self._set_extra_params_names(extra_params_names)It fills up the list of names given what is not yet available (too short) in data.exog_names. IIRC
But I doubt I tested all combinations for setting extra param names.
josef-pkt commentedon Sep 19, 2013
In TModel which was one of my main test cases for GenericLikelihoodModel, I used the
initializemethod to overwrite some of the defaults, with a lineself._set_extra_params_names(extra_params_names)jseabold commentedon Sep 19, 2013
Added vuong_test for reference. Can be more general than a test for Poisson vs. Zero-Inflated, so maybe useful elsewhere.
jbrockmendel commentedon Sep 2, 2018
@josef-pkt this has been implemented right? Closeable?
jseabold commentedon Mar 14, 2021
Closed by #3908.