##load data
data(mesa.data.model)
data(mesa.data.res)
##Extract parameters,
par <- mesa.data.res$par.est$res.best$par.all
##... and the Hessian.
H <- mesa.data.res$par.est$res.best$hessian.all
##run the MCMC, this may take a while...
MCMC.res <- run.MCMC(par, mesa.data.model, N = 5000,
Hessian.prop = H, silent = FALSE)
##Get the precomputed results instead.
MCMC.res <- mesa.data.res$MCMC.res
##components of the MCMC results
names(MCMC.res)
##The acceptance probability (alpha) for each step
##in the Metropolis-Hastings algorithm.
summary(MCMC.res$acceptance)
##The MCMC-estimated parameters
summary(MCMC.res$par)
##MCMC tracks for four of the parameters
par(mfrow=c(4,1),mar=c(2,2,2.5,.5))
for(i in c(4,9,13,15)){
plot(MCMC.res$par[,i], ylab="", xlab="", type="l",
main=colnames(MCMC.res$par)[i])
}
Run the code above in your browser using DataLab