Batch size (truncation point) selection
Function returns the optimal batch size (or truncation point) for a given chain and method.
batchSize(x, method = "bm", g = NULL)
x |
a matrix or data frame of Markov chain output. Number of rows is the Monte Carlo sample size. |
method |
any of |
g |
a function that represents features of interest. g is applied to each row of |
A value of the optimal batch size is returned.
Liu, Y., Vats, D., and Flegal, J. M. Batch size selection for variance estimators in MCMC, arXiv preprint arXiv:1804.05975 (2019).
mcse.multi
, which calls on batchSize
.
mcse
, which calls on batchSize
.
library(mAr) p <- 3 n <- 1e3 omega <- 5*diag(1,p) ## Making correlation matrix var(1) model set.seed(100) foo <- matrix(rnorm(p^2), nrow = p) foo <- foo %*% t(foo) phi <- foo / (max(eigen(foo)$values) + 1) out <- as.matrix(mAr.sim(rep(0,p), phi, omega, N = n)) batchSize(out) batchSize(out, method = "obm") batchSize(out, method = "bartlett")
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.