-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Create native Dirichlet multinomial family #1729
Create native Dirichlet multinomial family #1729
Conversation
Thank you! This PR looks good overall, I think. Why are not confident about posterior_epred? You should be able to test it by comparing its output against the known(?) mean of the dirichlet_mulinomial distribution. I currently don't have time to check this detail myself. |
Thanks @paul-buerkner for taking a look at the PR - much appreciated. I've now checked I also had a quick scan of the checks above in case the failed checks were related to the dirichlet_multinomial family - I don't think they are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now checked the PR once again in a bit more detail and found a few more minor things to adjust before the PR is ready to be merged.
remove (unused) cats and alpha variables from log_lik_dirichlet_multinomial, and call posterior_epred_multinomial within posterior_epred_dirichlet_multinomial with explanatory comment
Thanks @paul-buerkner for reviewing my pull request, and for your helpful comments and suggestions. I've made some minor updates in the latest commit, which hopefully address your questions. |
Thanks! Can you add the initial transformations and check also do the density function as discussed above? Then the PR should be ready for merging. |
I'll implement the checks in the density function as requested above. Though I'm not sure what you mean by initial transformations? Do you also want me to add a specific help page for the dirichlet multinomial describing the parameterisation of the distribution (similar to |
add checks for dimensions of eta, and improve documentation
I meant if (is.null(dim(eta))) {
eta <- matrix(eta, nrow = 1)
} but you already added that. I think it is fine if we keep the density internal for now. Just as we have it with dmultinomial. I will check the PR once again and then merge. |
OK great - thanks again for all your help with this! |
Will merge now. Thank you for your contribution to brms! I highly appreciate it! |
Thanks @paul-buerkner, it was a pleasure to contribute and the least I can do as a very grateful user of brms! |
Following discussion in #1728, I've had a go at creating a native Dirichlet multinomial family.
I've attempted to update the documentation of
brmsfamily
, and added some tests too.I'm not confident that the
posterior_epred.R
function is correct, and probably should not have included it.Hopefully this is helpful - please let me know if you need anything more from me. And thanks again @paul-buerkner for all your help with this!