kmbayes_diagnose: MCMC diagnostics using rstan

Description Usage Arguments Examples

View source: R/diag_funs.R

Description

Give MCMC diagnostistics from the rstan package using the Rhat, ess_bulk, and ess_tail functions. Note that r-hat is only reported for bkmrfit.list objects from kmbayes_parallel

Usage

1
2
3

Arguments

kmobj

Either an object from kmbayes or from kmbayes_parallel

...

arguments to monitor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(111)
dat <- bkmr::SimData(n = 50, M = 4)
y <- dat$y
Z <- dat$Z
X <- dat$X
set.seed(111)
Sys.setenv(R_FUTURE_SUPPORTSMULTICORE_UNSTABLE="quiet")
future::plan(strategy = future::multiprocess)
fitkm.list <- kmbayes_parallel(nchains=2, y = y, Z = Z, X = X, iter = 1000,
  verbose = FALSE, varsel = TRUE)
kmbayes_diag(fitkm.list)
kmbayes_diag(fitkm.list[[1]]) # just the first chain

closeAllConnections()

bkmrhat documentation built on Feb. 18, 2021, 1:09 a.m.