mcmc_diagnostics {bpr} | R Documentation |
This function is a method for class poisreg
. It prints convergence diagnostics and accuracy statistics of the MCMC output.
mcmc_diagnostics(object)
object |
object of class " |
The printed output of mcmc_diagnostics
summarizes some common convergence diagnostics for Markov chains.
The first part recaps the total length, burn-in and thinning used for the simulation.
The second part is a table with diagnostic statistics about each chain of the regression parameters. The first column is the effective sample size computed after removing the burn-in and thinning. The last two columns report the value and observed p-value of the Geweke test of equality of the first and last part of the chain.
The last part is printed only if multiple chains are computed. In this case, it reports the Gelman-Rubin statistics to test convergence to the same stationary distribution. Values much larger than 1 suggest lack of convergence to a common distribution.
mcmc_diagnostics
returns a list with elements:
chain_length
: total length of the MCMC chains.
len_burnin
: the length of the burn-in used to compute the estimates.
thin
: the thinning frequency used (from object
).
effSize
: effective sample size of each parameter chain after removing burn-in and thinning. See effectiveSize
.
geweke
: Geweke diagnostics of convergence of the chains (value of the test and p-value). See geweke.diag
gelman_rubin
: if nchains > 1
, Gelman-Rubin diagnostics of convergence. See gelman.diag
.
summary.poisreg
, plot.poisreg
,
merge_sim
, effectiveSize
, geweke.diag
, gelman.diag
# For examples see example(sample_bpr)