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

Allow any CSV of parameters to be passed to generate_quantities #1028

Closed
somebody-cool opened this issue Aug 2, 2021 · 2 comments
Closed

Comments

@somebody-cool
Copy link

Summary:

Seems related to stan-dev/stan#2968 but I can't tell where y'all landed on that.

Currently, when I try and call a generate_quantities against a stan program using a fitted parameters CSV, it needs to be the literal output file from an HMC run, when I'd like to be able to use arbitrary CSV files.

Description:

Currently, when I try and call a generated_quantities against a stan program using a fitted parameters CSV, it'll fail with with Error reading fitted param names from sample csv file "[FILENAME]" unless I have a header. It also fails with Mismatch between model and fitted_parameters csv file "[FILENAME]" unless I have the HMC diagnostic outputs ("lp__", "accept_stat__", "stepsize__", "treedepth__", "n_leapfrog__", "divergent__", "energy__"). I don't think any of this information is to generate quantities consistent with particular fitted parameters, and not requiring this makes many workflows easier. In particular, it would let me unit test user defined stan functions using the generated quantities method for keeping code quality high, and let me stress test behavior of the model under extreme conditions that are difficult to simulate. Currently, I'm injecting garbage information in both the header and the HMC diagnostic columns from a template, but that's a rather awkward interface.

Reproducible Steps:

Run generated_quantities against any stan program without the header or HMC diagnostic columns.

Current Output:

  • Error reading fitted param names from sample csv file "[FILENAME]"
  • Mismatch between model and fitted_parameters csv file "[FILENAME]"

Expected Output:

Normal Stan output

Current Version:

v2.27.0

@mitzimorris
Copy link
Member

here's the description of what's needed in the Stan CSV file: https://mc-stan.org/docs/2_27/cmdstan-guide/stan-csv.html#mcmc-sampler-csv-output

good luck.

@WardBrian
Copy link
Member

A combination of #1106 and stan-dev/stan#3179 have allowed this

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

No branches or pull requests

3 participants