cmdstan: `generate_quantities` handles `save_warmup=True` "wrong".
Summary:
If save_warmup=True, generate_quantities takes the first num_samples warmup and samples to generate the gqs.
https://github.com/stan-dev/cmdstan/blob/develop/src/cmdstan/command.hpp
size_t num_cols = param_names.size();
size_t num_rows = fitted_params.metadata.num_samples;
// check that all parameter names are in sample, in order
if (num_cols + hmc_fixed_cols > fitted_params.header.size()) {
msg << "Mismatch between model and fitted_parameters csv file \"" << fname
<< "\"" << std::endl;
throw std::invalid_argument(msg.str());
}
for (size_t i = 0; i < num_cols; ++i) {
if (param_names[i].compare(fitted_params.header[i + hmc_fixed_cols])
!= 0) {
msg << "Mismatch between model and fitted_parameters csv file \""
<< fname << "\"" << std::endl;
throw std::invalid_argument(msg.str());
}
}
return_code = stan::services::standalone_generate(
model,
fitted_params.samples.block(0, hmc_fixed_cols, num_rows, num_cols),
random_seed, interrupt, logger, sample_writer);
Has to be changed into something that handles this differently, also incorporating the thinning parameter.
Current Version:
v2.26.1
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (8 by maintainers)
going with option a) then, draws in the
fitted_paramscsv file will be used, all of them. CmdStanPy will have to document this, and could also print info message to user that warmup draws are present.(off topic, but noted here: if CmdStanPy wants to get fancier, it could - I suggest we don’t and push back on Python users to do their own data munging)