summary.dreamer_mcmc: Summarize Model Output

View source: R/summary.R

summary.dreamer_mcmcR Documentation

Summarize Model Output

Description

Produces summaries for inference and diagnosing MCMC chains.

Usage

## S3 method for class 'dreamer_mcmc'
summary(object, ...)

Arguments

object

MCMC output from a dreamer model.

...

additional arguments which are ignored.

Value

A tibble with inference and diagnostics information for each parameter.

Examples

set.seed(888)
data <- dreamer_data_linear(
  n_cohorts = c(20, 20, 20),
  dose = c(0, 3, 10),
  b1 = 1,
  b2 = 3,
  sigma = 5
)

# Bayesian model averaging
output <- dreamer_mcmc(
 data = data,
 n_adapt = 1e3,
 n_burn = 1e3,
 n_iter = 1e4,
 n_chains = 2,
 silent = FALSE,
 mod_linear = model_linear(
   mu_b1 = 0,
   sigma_b1 = 1,
   mu_b2 = 0,
   sigma_b2 = 1,
   shape = 1,
   rate = .001,
   w_prior = 1 / 2
 ),
 mod_quad = model_quad(
   mu_b1 = 0,
   sigma_b1 = 1,
   mu_b2 = 0,
   sigma_b2 = 1,
   mu_b3 = 0,
   sigma_b3 = 1,
   shape = 1,
   rate = .001,
   w_prior = 1 / 2
 )
)

# all models (also show model weights)
summary(output)

# single model
summary(output$mod_linear)

dreamer documentation built on Sept. 1, 2022, 5:05 p.m.