Estimating the SE of MCMC outputs; different methods
# Strategy to manage correctly the MCMC timeseries to get SE set.seed(123) val <- rnorm(30, 10, 2) dnormx <- function(data, x) { data <- unlist(data) return(-sum(dnorm(data, mean=x['mean'], sd=x['sd'], log=TRUE))) } parameters_mcmc <- data.frame(Density=c('dnorm', 'dlnorm'), Prior1=c(10, 0.5), Prior2=c(2, 0.5), SDProp=c(0.35, 0.2), Min=c(-3, 0), Max=c(100, 10), Init=c(10, 2), stringsAsFactors = FALSE, row.names=c('mean', 'sd')) # Use of trace and traceML parameters # trace=1 : Only one likelihood is printed mcmc_run <- MHalgoGen(n.iter=50000, parameters=parameters_mcmc, data=val, ...