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 was looking into implementing likelihood ratio tests which already exists for linear model
Rather than simply duplicating it, I wanted to understand how this should be implemented so that such tests are available to other likelihood models too. [For e.g. GLM] And GenericLikelihoodModelResults seems to be an appropriate class, probably designed with this in mind?
As far as I know this is not currently present at a high level in the results class hierarchy. Some models have a df_model attribute that you could use to calculate the degrees of freedom of the parent and sub-model. I'm not sure if you can generically test if the models are nested, we might have to trust the user on that. It might also be interesting to provide a generic way to use the F distribution rather than chi^2. Somewhere in the lmer mailing archives there is a lot of debate about how to calculate F distribution degrees of freedom for mixed models. There have also been some efforts to provide generic score tests, e.g. #2054.
The proper class for the LR test is LikelihoodModel. GenericLikelihoodModel is not used as a super class for our main models.
The principle for the LR test is pretty generic, but in many cases there are recommendations of keeping some nuisance parameters (like variance or penalization-degrees of freedom, or weight matrices) fixed in the comparison. We are not supporting any of those in a generic LR test.
The main reason I didn't put compare_lr_test higher up was that I didn't find a reference for unit tests across models,
For GLM the LR test also works for quasi likelihood with over dispersion but the llf needs to be corrected by the dispersion estimate.
(The main advantage of score and Wald test is that they extend to QMLE and don't require that the likelihood is correctly specified, while LR test does. So, the emphasis in my work in the last year was for those two tests and I didn't do much with LR tests.)
Additionally,
neither Stata nor R has generic support for either LR or score tests, as far as I could see, so it is not so easy to just write unit tests to decide on and verify the results.
So we need to find special cases to verify that a generic solution is doing what it's supposed to be doing.
(And then it usually takes me a long time to feel confident enough or to make up my mind.)
Activity
kshedden commentedon Jun 5, 2015
As far as I know this is not currently present at a high level in the results class hierarchy. Some models have a
df_modelattribute that you could use to calculate the degrees of freedom of the parent and sub-model. I'm not sure if you can generically test if the models are nested, we might have to trust the user on that. It might also be interesting to provide a generic way to use the F distribution rather than chi^2. Somewhere in the lmer mailing archives there is a lot of debate about how to calculate F distribution degrees of freedom for mixed models. There have also been some efforts to provide generic score tests, e.g. #2054.josef-pkt commentedon Jun 5, 2015
The proper class for the LR test is LikelihoodModel. GenericLikelihoodModel is not used as a super class for our main models.
The principle for the LR test is pretty generic, but in many cases there are recommendations of keeping some nuisance parameters (like variance or penalization-degrees of freedom, or weight matrices) fixed in the comparison. We are not supporting any of those in a generic LR test.
The main reason I didn't put compare_lr_test higher up was that I didn't find a reference for unit tests across models,
For GLM the LR test also works for quasi likelihood with over dispersion but the llf needs to be corrected by the dispersion estimate.
(The main advantage of score and Wald test is that they extend to QMLE and don't require that the likelihood is correctly specified, while LR test does. So, the emphasis in my work in the last year was for those two tests and I didn't do much with LR tests.)
josef-pkt commentedon Jun 5, 2015
Additionally,
neither Stata nor R has generic support for either LR or score tests, as far as I could see, so it is not so easy to just write unit tests to decide on and verify the results.
So we need to find special cases to verify that a generic solution is doing what it's supposed to be doing.
(And then it usually takes me a long time to feel confident enough or to make up my mind.)
ENH: compare_lr_test to LikelihoodModelResults
ENH: compare_lr_test to LikelihoodModelResults
ENH: Move compare_lr_test to LikelihoodModelResults
ENH: Move compare_lr_test to GenericLikelihoodModel
ENH: Move compare_lr_test to LikelihoodModelResults