The function applies either Gelman-Rubin or the Geweke diagnostic to the raw output of model simulation (e.g. bhpm.cluster.BB.hier3). It returns the convergence diagnostics and, if applicable, the acceptance rates for the sampling distributions.
The output from a model simulation.
This function applies one of two convergence diagnostics to the raw output of a model simulation in order to allow convergence to be assessed. The two diagnotics are:
i) Gelman-Rubin diagnostic - used when there is more than one chain. A value close to 1 is consistent with an MCMC simulation which has converged. The ‘coda’ diagnostic returns a point estimate and upper confidence limits.
ii) Geweke diagnostic - used when there is a single chain. A Z-score which is consistent with a standard normal distribution is expected from an MCMC simulation which has converged.
The raw sample data is converted to ‘coda’ format (mcmc objects) and the ‘coda’ methods gelman.diag and geweke.diag are used to perform the checks.
Returns a list of the diagnostics for each sampled variable. Each individual element of the list is a data.frame containing at least the columns type, which is the type of diagnostic (‘Gelman-Rubin’ or ‘Geweke’), stat, which is the value of the dignostic, and upper_ci which is the upper confidence interval for the Gelman-Rubin diagnostic. For the Geweke diagnostic upper_ci contains the value NA. Depending on the simulation performed the return from bhpm.convergence.diag will contain different variables. Columns which may be used to indentify the individual samples are Trt.Grp, Outcome.Grp, Outcome, and Cluster.
1 2 3 4 5 6 7 8 9
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.