R_hat
computes Gelman-Rubin convergence diagnostics based on the MCMC output
in a model component, and n_eff
computes the effective sample sizes, .i.e.
estimates for the number of independent samples from the posterior distribution.
R_hat(dc)n_eff(dc, useFFT = TRUE, lag.max, cl = NULL)
In case of R_hat
the split-R-hat convergence diagnostic for each
component of the vector parameter, and in case of n_eff
the effective
number of independent samples for each component of the vector parameter.
a draws component (dc) object corresponding to a model parameter.
whether to use the Fast Fourier Transform algorithm. Default is TRUE
as this is typically faster.
the lag up to which autocorrelations are computed in case useFFT=FALSE
.
a cluster for parallel computation.
A. Gelman and D. B. Rubin (1992). Inference from Iterative Simulation Using Multiple Sequences. Statistical Science 7, 457-511.
A. Gelman, J.B. Carlin, H.S. Stern, D.B. Dunson, A. Vehtari and D.B. Rubin (2013). Bayesian Data Analysis, 3rd edition. Chapman & Hall/CRC.
# \donttest{
ex <- mcmcsae_example()
sampler <- create_sampler(ex$model, data=ex$dat)
sim <- MCMCsim(sampler, burnin=100, n.iter=300, thin=2, n.chain=4, store.all=TRUE)
n_eff(sim$beta)
n_eff(sim$v_sigma)
n_eff(sim$v_rho)
R_hat(sim$beta)
R_hat(sim$llh_)
R_hat(sim$v_sigma)
# }
Run the code above in your browser using DataLab