Reading into R from cmdstan

What’s the go to method for reading in a cmdstan output into R?

I’m using read_stan_csv(), which worked in a previous set up but not working now.

I see some talk about it but I’m not using cmdstanr.

I’m getting errors like:

object 'n_kept' not found In addition: Warning message: In parse_stancsv_comments(comments) : NAs introduced by coercion

But there’s no MCMC diagnostic issues.

here

Yeah, I have some items from generated quantities I just want to get the vectors I’ve computed.

Before I could just use samples = rstan::extract(csv) and then samples$y_pred_in for in sample predictions, for example, trying to figure out how to do this in current rstan stack.

I just need the items I’ve generated in generated quantities, to see prediction accuracy, etc.

ok, for example

fit = as_cmdstan_fit("foo.csv"); fit$draws("y_pred");

closing this

1 Like