Description Usage Arguments Value References See Also Examples
Function returns the estimate of the covariance matrix in the Markov Chain central limit theorem using initial sequence method. This method is designed to give an asymptotically conservative estimate of the Monte Carlo standard error.
1 | mcse.initseq(x, g = NULL, adjust = FALSE, blather = FALSE)
|
x |
A matrix or data frame of Markov chain output. Number of rows is the Monte Carlo sample size. |
g |
A function that represents features of interest. |
adjust |
Logical; if |
blather |
if |
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 |
eigen_values |
eigen values of the estimate cov. |
method |
method used to calculate matrix cov. |
est |
estimate of g(x). |
nsim |
number of rows of the input x. Only if |
Adjustment_Used |
logical of whether an adjustment was made to the initial sequence estimator.
Only if |
Dai, N and Jones, G.L. (2017) Multivariate initial sequence estimators in Markov chain Monte Carlo, Journal of Multivariate Analysis, 159, 184-199.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Bivariate Normal with mean (mu1, mu2) and covariance sigma
n <- 1e3
mu <- c(2, 50)
sigma <- matrix(c(1, 0.5, 0.5, 1), nrow = 2)
out <- BVN_Gibbs(n, mu, sigma)
out.mcse <- mcse.initseq(x = out)
out.mcse.adj <- mcse.initseq(x = out, 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 = out, g = g)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.