View source: R/plot_diagnostics.R
| plot_energy | R Documentation |
Creates overlaid histograms of marginal energy and energy transition, along with the E-BFMI statistic. Low E-BFMI indicates poor exploration of the posterior.
plot_energy(fit)
fit |
A |
E-BFMI (Energy Bayesian Fraction of Missing Information) compares the distribution of energy levels to energy transitions. Values below 0.3 indicate the sampler may not be exploring the full posterior.
A ggplot object (if ggplot2 available) or base R plot.
diagnostic_summary(), check_diagnostics()
set.seed(123)
df <- data.frame(x = rnorm(60))
df$y <- rpois(60, exp(0.5 + 0.3 * df$x))
fit <- tulpa(y ~ x, data = df, family = "poisson", mode = "hmc",
control = list(n_iter = 500L, warmup = 250L, n_chains = 2L,
seed = 1L))
plot_energy(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.