multiESS {mcmcse} | R Documentation |
Effective Sample Size of a multivariate Markov chain as described in Vats et al. (2015).
Description
Calculate the effective sample size of the Markov chain, using the multivariate dependence structure of the process.
Usage
multiESS(x, covmat = NULL, g = NULL, ...)
Arguments
x |
a matrix or data frame of Markov chain output. Number of rows is the Monte Carlo sample size. |
covmat |
optional matrix estimate obtained using |
g |
a function that represents features of interest. |
... |
arguments for |
Details
Effective sample size is the size of an iid sample with the same variance as the current sample. ESS is given by
ESS = n\frac{|\Lambda|^{1/p}}{|\Sigma|^{1/p}},
where \Lambda
is the
sample covariance matrix for g
and \Sigma
is an estimate of the Monte Carlo standard
error for g
.
Value
The function returns the estimated effective sample size.
References
Vats, D., Flegal, J. M., and, Jones, G. L Multivariate output analysis for Markov chain Monte Carlo, Biometrika, 106, 321–-337.
See Also
minESS
, which calculates the minimum effective samples required for the
problem.
ess
which calculates univariate effective sample size using a Markov chain and a
function g.
Examples
## 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)
multiESS(out)