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

Extracting gradient of log posterior and unconstrained parameters #827

Closed
simonrmaskell opened this issue Aug 22, 2023 · 2 comments
Closed
Labels
feature New feature or request

Comments

@simonrmaskell
Copy link

We're keen to enable Stan's users to capitalise on control variates. To make that possible (in R), one route would be to add functionality to posterior and to CmdStanR (which I now understand to use posterior to generate the summaries that control variates could sensibly augment). See here: stan-dev/posterior#273.

To make that possible, we'll need to get the gradient of the log posterior with respect to the unconstrained parameters and the unconstrained parameters themselves out of CmdStanR. We're happy to expend effort to make this happen, but would welcome perspectives on how this might best be achieved.

@simonrmaskell simonrmaskell added the feature New feature or request label Aug 22, 2023
@jgabry
Copy link
Member

jgabry commented Aug 22, 2023

In the latest version of cmdstanr @andrjohns added methods grad_log_prob, unconstrain_variables, and unconstrain_draws. Does that give you what you need?

@simonrmaskell
Copy link
Author

Awesome. Yes, I think so. Thank you @jgabry and @andrjohns !!

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

No branches or pull requests

3 participants