check.convergence: Diagnostic plots for the evaluation of the convergence of the...

Description Usage Arguments Value Author(s) Examples

View source: R/check.convergence.R

Description

The check.convergence function provides two plots (selectable by which) to investigate the convergence of the posterior distribution towards the target distribution at different stages of the algorithm.

Usage

1
2
  check.convergence(x, which = c(1L:2L), nsplit = 10, nbloc = 4,
               ask = prod(par("mfcol")) < length(which) && dev.interactive())

Arguments

x

an object of class ESS

.

which

if a subset of the plots is required, specify a subset of the numbers '1:2'.

nsplit

number of splits: the number of sweep intervals to consider.

nbloc

number of moving windows to plot.

ask

ask: logical; if 'TRUE', the user is _ask_ed before each plot, see 'par(ask=.)'

Value

The function check.convergence produces plots to assess the stability of the density estimates of the log posterior distribution. Two sets of graphs are plotted: the first set displays the density estimates of the log posterior distribution based on (i) all the sweep (ii) first half of the sweeps (iii) second half of the sweeps. The second plot represents similar density estimates at different stages of the MCMC procedure according to a sliding window whose characteristics are defined by the number of splits nsplit (i.e. the number of sweep intervals to consider) and number of blocks nbloc (i.e. the number of density estimates to plot).

Author(s)

Benoit Liquet, b.liquet@uq.edu.au,
Marc Chadeau-Hyam m.chadeau@imperial.ac.uk,
Leonardo Bottolo l.bottolo@imperial.ac.uk,
Gianluca Campanella g.campanella11@imperial.ac.uk

Examples

1
2
3
4
5
# load an ESS object
modelY_Hopx <- example.as.ESS.object()
check.convergence(modelY_Hopx,nsplit=10,nbloc=4)
check.convergence(modelY_Hopx,nsplit=5,nbloc=4)
check.convergence(modelY_Hopx,nsplit=5,nbloc=2)

R2GUESS documentation built on May 2, 2019, 1:47 p.m.