| mcmc_draws | R Documentation |
Returns a fit's posterior draws only when they form a genuine MCMC chain
($draws_kind == "chain", or an untagged legacy fit); for an i.i.d. /
approximation fit (nested Laplace, VI, SMC, ...) it returns NULL, because
chain diagnostics do not apply. This is the accessor diagnostics()
gates on. For the provenance-agnostic posterior sample used by summaries,
see posterior_sample().
mcmc_draws(fit)
fit |
A |
The chain draws matrix/array, or NULL for a non-chain fit.
posterior_sample(), diagnostics()
set.seed(1)
d <- data.frame(x = rnorm(60))
d$y <- rpois(60, exp(0.5 + 0.3 * d$x))
fit <- tulpa(y ~ x, data = d, family = "poisson", mode = "hmc",
control = list(n_iter = 400L, warmup = 200L, n_chains = 2L,
seed = 1L))
dim(mcmc_draws(fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.