Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

kmbayes_diagnose

MCMC diagnostics using rstan


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

kmbayes_diagnose(kmobj, ...)

kmbayes_diag(kmobj, ...)

Arguments

kmobj

Either an object from kmbayes or from kmbayes_parallel

...

arguments to monitor

Examples

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

Parallel Chain Tools for Bayesian Kernel Machine Regression

v1.0.2
GPL (>= 3)
Authors
Alexander Keil [aut, cre]
Initial release
2021-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.