mcmcse (version 1.3-2)

mcse.initseq: Multivariate Monte Carlo standard errors for expectations with the initial sequence method of Dai and Jones (2017).

Description

Function returns the estimate of the covariance matrix in the Markov Chain CLT using initial sequence method. The function also returns the volume of the resulting ellipsoidal confidence regions. This method is designed to give an asymptotically conservative estimate of the Monte Carlo standard error.

Usage

mcse.initseq(x, adjust = FALSE, g = NULL, level = 0.95)

Arguments

x

a matrix or data frame of Markov chain output. Number of rows is the Monte Carlo sample size.

adjust

logical; if TRUE, an adjustment is made to increase slightly the eigenvalues of the initial sequence estimator. The default is FALSE.

g

a function that represents features of interest. g is applied to each row of x and thus g should take a vector input only. If g is NULL, g is set to be identity, which is estimation of the mean of the target density.

level

confidence level of the confidence region.

Value

A list is returned with the following components,

cov

a covariance matrix estimate using intial sequence method.

cov.adj

a covariance matrix estimate using adjusted initial sequence method if the input adjust=TRUE.

vol

volume of the confidence region to the pth root using intial sequence method, where p is the dimension of the confidence region.

vol.adj

volume of the confidence region to the pth root using adjusted initial sequence method if the input adjust=TRUE, where p is the dimension of the confidence region.

est

estimate of g(x).

nsim

number of rows of the input x.

adjust

logical of whether an adjustment was made to the initial sequence estimator.

References

Dai, N and Jones, G.L. (2017+) Multivariate initial sequence estimators in Markov chain Monte Carlo, Journal of Multivariate Analysis.

See Also

initseq{mcmc}, which is a different univariate initial sequence estimator. mcse, which acts on a vector. mcse.mat, which applies mcse to each column of a matrix or data frame. mcse.q and mcse.q.mat, which compute standard errors for quantiles. mcse.multi, which estimates the covariance matrix in the Markov Chain CLT using batch means or spectral variance methods.

Examples

Run this code
# NOT RUN {
library(mAr)
p <- 3
n <- 1000
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)

dat <- as.matrix(mAr.sim(rep(0,p), phi, omega, N = n))

out.mcse <- mcse.initseq(x = dat)
out.mcse.adj  <- mcse.initseq(x = dat,adjust = TRUE)

# If we are only estimating the mean of the first component, 
# and the second moment of the second component
g <- function(x) return(c(x[1], x[2]^2))
out.g.mcse <- mcse.initseq(x = dat, g = g)
# }

Run the code above in your browser using DataLab