We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
unconstrain_draws() doc has the following example
unconstrain_draws()
fit_mcmc$unconstrain_draws(draws = fit_mcmc$draws())
but this does not work if there are other variables (transformed parameters or generated quantities) stored in the draws, and fails with an error like
Error: Model has 469 unconstrained parameter(s), but 188800 were provided!
It is not trivial to figure out how to proceed after this error
The text was updated successfully, but these errors were encountered:
Hmm I can't replicate this, the following works for me without issue:
modcode <- " data { real y_mean; } parameters { real y; } model { y ~ normal(y_mean, 1); } generated quantities { vector[10] y_gq = rep_vector(y * 2, 10); } " mod <- cmdstan_model(write_stan_file(modcode)) fit <- mod$sample(data = list(y_mean = 0), parallel_chains=4) dr <- fit$draws() fit$init_model_methods() tes <- fit$unconstrain_draws() tes <- fit$unconstrain_draws(draws = dr)
Sorry, something went wrong.
Sorry, it was grad_log_prob()
grad_log_prob()
> fit$grad_log_prob(fit$unconstrain_draws(draws = dr)) Error: Model has 1 unconstrained parameter(s), but 4000 were provided!
After discussion with @andrjohns , this is just a case of bit unclear error message for invalid input
No branches or pull requests
unconstrain_draws()
doc has the following examplebut this does not work if there are other variables (transformed parameters or generated quantities) stored in the draws, and fails with an error like
It is not trivial to figure out how to proceed after this error
The text was updated successfully, but these errors were encountered: