library(MCMCpack)
line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5)) # Using fake data
posterior <- MCMCregress(Y ~ X, data=line, b0 = 0, B0 = 0.1,
c0 = 0.01, d0 = 0.01,
burnin = 1000, mcmc = 2000, thin = 2)
# plot(posterior) # plotting the posterior distributions
raftery.diag(posterior) # diagnostics
Quantile (q) = 0.025
Accuracy (r) = +/- 0.005
Probability (s) = 0.95
You need a sample size of at least 3746 with these values of q, r and s
Iterations = 1001:2999
Thinning interval = 2
Number of chains = 1
Sample size per chain = 1000
1. Empirical mean and standard deviation for each variable,
plus standard error of the mean:
Mean SD Naive SE Time-series SE
(Intercept) 2.9491 0.4274 0.01352 0.013516
X 0.7881 0.3264 0.01032 0.009737
sigma2 1.1681 1.8806 0.05947 0.067804
2. Quantiles for each variable:
2.5% 25% 50% 75% 97.5%
(Intercept) 2.08909 2.7161 2.9561 3.1959 3.787
X 0.08524 0.6262 0.7999 0.9594 1.425
sigma2 0.17335 0.3825 0.6655 1.2215 5.285
