-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
lrtest
for model families with dispersion (#261)
`lrtest` relied on the deviance rather than the log-likelihood, which is not correct for model families where a dispersion parameter needs to be taken into account. Scaling the deviance would be more efficient than computing the log-likelihood, but there is currently no generic API for this and this may not work for non-GLM models, so simply call `loglikelihood`. We could imagine defining a `likelihoodratio(m1, m2) = loglikelihood(m1) - loglikelihood(m2)` method that packages could override for performance, but this may not be worth it. Also make the check that more complex models have a strictly better fit than simpler nested ones less strict. The more complex model may have the same deviance, and due to approximations it may even have a slightly higher deviance.
- Loading branch information
Showing
2 changed files
with
75 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters