Learn R Programming

BayHap (version 1.0.1)

conv.test: Heidelberger and Welch Convergence Diagnostics

Description

Computes the Heidleberger and Welch convergence diagnostics for the parameters in an MCMC sequence.

Usage

conv.test(x, alpha = 0.05, error = 1e-05, keep.rares.conv = FALSE)

Arguments

x
An object of class reg or class freq.
alpha
Alpha level for the confidence in the sample mean of the retained iterations.
error
Accuracy of the posterior estimates for the parameters.
keep.rares.conv
Logical. TRUE or FALSE indicating whether the diagnostic of convergence must be carried out also for the rares category.

Value

A matrix whose columns and rows are the Heidleberger and Welch convergence diagnostics (i.e. stationarity test, number of iterations to keep and to drop, Cramer-von-Mises statistic, halfwidth test, mean, and halfwidth) and the monitored parameters, respectively.

Details

Take care when setting keep.rares.conv as TRUE. The chain for this parameter tends to be unstable and could lead to an error.

References

Heidelberger, P. and Welch, P. (1983). Simulation run length control in the presence of an initial transient. Operations Research, 31, 1109-44.