initseq {mcmc} | R Documentation |
Initial Sequence Estimators
Description
Variance of sample mean of functional of reversible Markov chain using methods of Geyer (1992).
Usage
initseq(x)
Arguments
x |
a numeric vector that is a scalar-valued functional of a reversible Markov chain. |
Details
Let
considered as a function of the lag be
the autocovariance function of the input time series.
Define
the sum of consecutive pairs of autocovariances. Then Theorem 3.1 in
Geyer (1992) says that considered as a function of
is strictly positive, strictly decreasing, and strictly convex,
assuming the input time series is a scalar-valued functional of a reversible Markov
chain. All of the MCMC done by this package is reversible.
This R function estimates the “big gamma” function,
considered as a function of
, subject to three different constraints, (1) nonnegative,
(2) nonnegative and nonincreasing, and (3) nonnegative, nonincreasing,
and convex. It also estimates the variance in the Markov chain central
limit theorem (CLT)
Note: The batch means provided by metrop
are also
scalar functionals of a reversible Markov chain. Thus these initial sequence
estimators applied to the batch means give valid standard errors for the
mean of the match means even when the batch length is too short to provide
a valid estimate of asymptotic variance. One does, of course, have to
multiply the asymptotic variance of the batch means by the batch length
to get the asymptotic variance for the unbatched chain.
Value
a list containing the following components:
gamma0 |
the scalar |
Gamma.pos |
the vector |
Gamma.dec |
the vector |
Gamma.con |
the vector |
var.pos |
the scalar |
var.dec |
the scalar |
var.con |
the scalar |
Bugs
Not precisely a bug, but var.pos
, var.dec
, and var.con
can be negative. This happens only when the chain is way too short to estimate
the variance, and even then rarely. But it does happen.
References
Geyer, C. J. (1992) Practical Markov Chain Monte Carlo. Statistical Science 7 473–483.
See Also
Examples
n <- 2e4
rho <- 0.99
x <- arima.sim(model = list(ar = rho), n = n)
out <- initseq(x)
## Not run:
plot(seq(along = out$Gamma.pos) - 1, out$Gamma.pos,
xlab = "k", ylab = expression(Gamma[k]), type = "l")
lines(seq(along = out$Gamma.dec) - 1, out$Gamma.dec, col = "red")
lines(seq(along = out$Gamma.con) - 1, out$Gamma.con, col = "blue")
## End(Not run)
# asymptotic 95% confidence interval for mean of x
mean(x) + c(-1, 1) * qnorm(0.975) * sqrt(out$var.con / length(x))
# estimated asymptotic variance
out$var.con
# theoretical asymptotic variance
(1 + rho) / (1 - rho) * 1 / (1 - rho^2)
# illustrating use with batch means
bm <- apply(matrix(x, nrow = 5), 2, mean)
initseq(bm)$var.con * 5