| posterior_sample | R Documentation |
Returns a fit's posterior draws for summary purposes (quantiles, derived
quantities, density plots), regardless of how they were produced – an MCMC
chain, a nested-Laplace node mixture, or a variational sample all answer
here. For the chain-only view used by convergence diagnostics, see
mcmc_draws().
posterior_sample(fit)
fit |
A |
A fit that carries no draws returns NULL with a message naming its backend,
the posterior representation it carries instead, and the accessor that turns
that representation into draws where one exists – an
absent draws matrix is a property of the backend, not a failure of the
accessor, and saying which is the difference between a diagnosable answer and
a bare NULL.
The posterior draws matrix/array, or NULL if the fit carries none.
mcmc_draws(), tulpa_posterior_draws(), diagnostics()
set.seed(1)
df <- data.frame(x = rnorm(80))
df$y <- rpois(80, exp(0.5 + 0.3 * df$x))
fit <- tulpa(y ~ x, data = df, family = "poisson")
dim(posterior_sample(fit))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.