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

discuss propto with double vs. autodiff variables in User's Guide #692

Open
bob-carpenter opened this issue Dec 7, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@bob-carpenter
Copy link
Contributor

Summary:

In the User's Guide chapter on efficiency, we should discuss the tradeoff between evaluating propto=true with double and autodiff variables.

Description:

The issue is that

  • propto=true requires us to compute autodiff in order to drop normalizing constant calculations (we drop ones that aren't autodiff vars)
  • propto=false requires computation of normalizing constants over double, but no autodiff

For double input, either of these can be faster depending on how expensive the normalizing constants are to compute

Current Version:

v2.32

@bob-carpenter
Copy link
Contributor Author

Also tie this in to how generated quantities work, in particular for _lupdf.

To do this, we'd have to explain how the C++ class worked and how propto=true vs. propto=false works. If we exposed propto in our user-defined functions, then we'd have to define this (and I think it would be nice if we could so that we could define proper _lupdf and _lpdf versions. It might make most sense to put this description in the reference manual.

@WardBrian
Copy link
Member

stanc will prevent a program from calling a lupdf in the generated quantities block, I assume for exactly this reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants