Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better loglikelihood for GLMM #419

Merged
merged 8 commits into from
Nov 5, 2020
Merged

Better loglikelihood for GLMM #419

merged 8 commits into from
Nov 5, 2020

Conversation

palday
Copy link
Member

@palday palday commented Oct 14, 2020

Amongst other things, this makes it so that the show(::GeneralizedLinearMixedModel) method works for models with a dispersion parameter.

(If it's not obvious from the commit history, this is me stripping off part of #291 so that at least some of those improvements make it in sooner rather than later.)

@palday palday marked this pull request as ready for review October 15, 2020 19:45
@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #419 into master will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   94.31%   94.39%   +0.07%     
==========================================
  Files          23       23              
  Lines        1637     1642       +5     
==========================================
+ Hits         1544     1550       +6     
+ Misses         93       92       -1     
Impacted Files Coverage Δ
src/MixedModels.jl 100.00% <ø> (ø)
src/generalizedlinearmixedmodel.jl 87.24% <100.00%> (+0.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 183c94a...db006fd. Read the comment docs.

@palday palday requested a review from dmbates October 15, 2020 19:58
Copy link
Collaborator

@dmbates dmbates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry not to review this previously. I just noticed now that you asked for my review.

At some point we should revisit the decision to use NaN for the value of sdest when there is no dispersion parameter. It seems that in modern Julia we should consider missing so we can extract a value of type T with coalesce(sdest(m), one(T)).

Thanks for straightening out the use of ϕ in loglikelihood.

@palday
Copy link
Member Author

palday commented Nov 5, 2020

So we had actually revisited that decision in a previous PR (#418, on GLMM parametric bootstrap) -- sdest and varest return missing for families without a dispersion parameter, but dispersion returns 1 for compatibility with GLM.jl. Over- and underdispersion are things I would like to think about there as well, but that comes after the dispersion parameter fits even work consistently.....

I've now merged those changes back into this branch and am re-running the tests.

@palday palday merged commit 8f55718 into master Nov 5, 2020
@palday palday deleted the palday/glmmloglikelood branch November 5, 2020 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants