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

mcse.mat

Apply mcse to each column of a matrix or data frame of MCMC samples.


Description

Apply mcse to each column of a matrix or data frame of MCMC samples.

Usage

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

Arguments

x

a matrix or data frame with each row being a draw from the multivariate distribution of interest.

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 floor(n^(1/2)) and “cuberoot” means size is floor(n^(1/3)).

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 parameter 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 good choices. ``r > 5'' is not recommended. Non-integer values are ok.

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

Monte Carlo Standard Errors for MCMC

v1.4-1
GPL (>= 2)
Authors
James M. Flegal <jflegal@ucr.edu>, John Hughes <j.hughes@ucdenver.edu>, Dootika Vats <dootika@iitk.ac.in>, and Ning Dai <daixx224@umn.edu>
Initial release
2020-01-29

We don't support your browser anymore

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