Get effective sample size

In RStan is there a better way to retrieve effective sample size for each parameter than summary(fit)$summary[, "n_eff"]? If not, does this include or exclude warmup iterations?


You can set probs to reduce the number of quantiles that are computed, although they aren’t that expensive relative to the effective sample size calculations. Summary does not include warmup iterations by default.

Thanks! Just wanted to make sure i wasn’t missing something obvious.

Perhaps the only subtle feature is that if you only want to get the effective sample size of some parameters then you can specify a “pars” argument. See for more information.

I looked into this a bit and it seems that the rstan diagnostic plots {stan_rhat(...), stan_ess(...), stan_mcse(...)} also just use summary(object, pars = pars)$summary to compute the diagnostics. So I don’t think you’re missing any better way of doing it