mcmcdiag {dirmcmc} | R Documentation |
mcmcdiag
Description
This function calculates all different diagnostics supported in this library and returns in a list
Usage
mcmcdiag(X)
Arguments
X |
Chain (Matrix) |
Details
This function calculates four metrics useful for diagnostics of a Markov chain. The chain input could be univariate or multivariate. The univariate summaries are calculated marginally, for each component for a multivariate chains. Effective sample size is calculated for each component. Integrared auto correlation times is also another componentwise measure calculated for all the components. Multivariate Effective sample size is calculated from mcmcse package. Mean squared jump distance is another multivariate summary measure that is returned.
Value
list with following elements:
MEss Multivariate Effective sample size.
ess vector of effective sample size for each component.
iact vector of integrated autocorrelation times for each component.
msjd Mean squared jump distance for the chain.
Author(s)
Abhirup Mallik, malli066@umn.edu
See Also
iact
for integrated auto correlation times, msjd
for mean squared jump distance of a chain, multiESS
for Multivariate effective sample size.
Examples
## Not run:
## Banana Target
lupost.banana <- function(x,B){
-x[1]^2/200 - 1/2*(x[2]+B*x[1]^2-100*B)^2
}
Banana Gradient
gr.banana <- function(x,B){
g1 <- -x[1]/100 - 2*B*(x[2]+B*x[1]^2-100*B)
g2 <- -(x[2]+B*x[1]^2-100*B)
g <- c(g1,g2)
return(g)
}
out.metdir.banana <- metropdir(obj = lupost.banana, dobj = gr.banana,
initial = c(0,1),lchain = 2000,
sd.prop=1.25,
steplen=0.01,s=1.5,B=0.03)
mcmcdiag(out.metdir.banana$batch)
## End(Not run)