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

Laplace approximation sampler command #1123

Closed
bob-carpenter opened this issue Oct 24, 2022 · 0 comments · Fixed by #1134
Closed

Laplace approximation sampler command #1123

bob-carpenter opened this issue Oct 24, 2022 · 0 comments · Fixed by #1134
Labels

Comments

@bob-carpenter
Copy link
Contributor

Summary:

Add a method to perform sampling from a Laplace approximation.

Description:

Add a Laplace approximation sampler that returns a sample .csv file with:

  • standard output configuration as comments at the top
  • header for names of constrained parameters, lp__ (target log density), and lq__ (approximation log density)
  • rows corresponding to draws on the constrained scale

The arguments required are

  • mode: a specification of a mode on the constrained scale using either

    • .csv format: a .csv file containing constrained parameters
      • # initial: comments that will be ignored; these can be anywhere
      • header: comma-separated names of constrained parameters in same format as our other output (e.g., sampling or optimization), with any names ending in double underscores (__) ignored; this must come before any value lines
      • values: there can be any number of rows for values, but only the final line is used
    • .json format: json specification of unconstrained values in the same format as used for initialization in other methods; all parameter values must be specified, and non-parameter values will be ignored
  • jacobian: boolean value indicating whether to include Jacobian adjustment or not; including provides max a posteriori (MAP) estimate, not including produces a (penalized) maximum likelihood estimate (MLE); default is true

  • draws: a positive integer indicating number of approximate draws to return; default is 100

  • refresh: an integer indicating how often to provide messages signaling which iteration has been processed; if this is not positive (<= 0), then no output will be produced for iterations (and ideally not for other messages from model class); default is 100

  • seed: a short unsigned integer to use as the random number generator; default is to generate randomly based on time

Additional Information:

The service function implementing Laplace sampling is: https://github.com/stan-dev/stan/blob/develop/src/stan/services/optimize/laplace_sample.hpp

Current Version:

v2.30.1

@WardBrian WardBrian linked a pull request Nov 15, 2022 that will close this issue
2 tasks
@WardBrian WardBrian linked a pull request Nov 28, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant