Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

conv.diag

MCMC Convergence Diagnostics


Description

This function computes Geweke's Convergence diagnostic making use of the coda package.

Usage

conv.diag(object, crit.val=1.96)

Arguments

object

a fitted bgvar object.

crit.val

critical value used for test statistic.

Details

Geweke (1992) proposed a convergence diagnostic for Markov chains based on a test for equality of the means of the first and last part of a Markov chain (by default we use the first 10% and the last 50%). If the samples are drawn from the stationary distribution of the chain, the two means are equal and Geweke's statistic has an asymptotically standard normal distribution. The test statistic is a standard Z-score: the difference between the two sample means divided by its estimated standard error. The standard error is estimated from the spectral density at zero and so takes into account any autocorrelation.

Value

Returns an object of class bgvar.CD. This is a list with

  • geweke.z Z-scores for a test of equality of means between the first and last parts of the chain. A separate statistic is calculated for each variable in each chain.

  • perc is the percentage of Z-scores exceeding crit.val (in absolute terms).

Author(s)

Martin Feldkircher

References

Geweke, J. (1992) Evaluating the accuracy of sampling-based approaches to calculating posterior moments. Bayesian Statistics 4 (edited by JM Bernado, JO Berger, AP Dawid and AFM Smith). Clarendon Press, Oxford, UK.

See Also

geweke.diag in the coda package.

Examples

library(BGVAR)
data(eerDatasmall)
model.mn <- bgvar(Data=eerDatasmall,W=W.trade0012.small,plag=1,draws=200,burnin=200,prior="MN")
geweke <- conv.diag(model.mn)

BGVAR

Bayesian Global Vector Autoregressions

v2.2.0
GPL-3
Authors
Maximilian Boeck [aut, cre] (<https://orcid.org/0000-0001-6024-8305>), Martin Feldkircher [aut] (<https://orcid.org/0000-0002-5511-9215>), Florian Huber [aut] (<https://orcid.org/0000-0002-2896-7921>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.