mcse.mat: Apply 'mcse' to each column of the MCMC samples.

Description Usage Arguments Value See Also

View source: R/mcmcse.R

Description

Apply mcse to each column of the MCMC samples.

Usage

1
mcse.mat(x, size = NULL, g = NULL, method = "bm", r = 3)

Arguments

x

a matrix of values from a Markov chain of size n x p.

size

represents the batch size in “bm” and the truncation point in “bartlett” and “tukey”. Default is NULL which implies that an optimal batch size is calculated using the batchSize function. Can take character values of “sqroot” and “cuberoot” or any numeric value between 1 and n/2. “sqroot” means size is \lfloor n^{1/2} \rfloor and “cuberoot” means size is \lfloor n^{1/3} \rfloor.

g

a function such that E(g(x)) is the quantity of interest. The default is NULL, which causes the identity function to be used.

method

any of “bm”,“obm”,“bartlett”, “tukey”. “bm” represents batch means estimator, “obm” represents overlapping batch means estimator with, “bartlett” and “tukey” represents the modified-Bartlett window and the Tukey-Hanning windows for spectral variance estimators.

r

The lugsail parameters (r) that converts a lag window into its lugsail equivalent. Larger values of r will typically imply less underestimation of “cov”, but higher variability of the estimator. Default is r = 3 and r = 1,2 are also good choices although may lead to underestimates of the variance. r > 5 is not recommended.

Value

mcse.mat returns a matrix with ncol(x) rows and two columns. The row names of the matrix are the same as the column names of x. The column names of the matrix are “est” and “se”. The jth row of the matrix contains the result of applying mcse to the jth column of x.

See Also

mcse, which acts on a vector.

mcse.multi, for a multivariate estimate of the Monte Carlo standard error.

mcse.q and mcse.q.mat, which compute standard errors for quantiles.


mcmcse documentation built on Sept. 9, 2021, 9:06 a.m.