Align R-side COM-Poisson functions with Stan - #1929
Open
LeonidasZhak wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Align the R-side
com_poissondistribution functions and mean with the parameterization used by Stan.Thanks to maintainers
Thanks to Paul and the brms maintainers for maintaining the package and for pointing out the preferred direction in the discussion of this issue.
Issue or motivation
Fixes #1927. After #1765 changed the Stan implementation, the R-side density, CDF, quantile, normalizing constant, and mean calculations still used the previous parameterization.
Root cause
The R functions multiplied the complete log-Poisson term by
shape, whereas the updated Stan model appliesshapeonly to the factorial term. The approximation formulas were also still expressed in terms of the previous parameterization.Change
Tests
R CMD build --no-manual --no-build-vignettes .R CMD check --as-cran --no-manual --ignore-vignettes brms_2.23.1.tar.gz: passed with the repository's existing two NOTES.testthat.Rrun: passed.Scope
This changes only the R-side calculations and regression coverage for
com_poisson. It does not change the Stan implementation, the public function interface, or unrelated distributions and vignettes.