Description Usage Arguments Value Author(s) Examples
View source: R/check.convergence.R
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.
1 2 | check.convergence(x, which = c(1L:2L), nsplit = 10, nbloc = 4,
ask = prod(par("mfcol")) < length(which) && dev.interactive())
|
x |
an object of class |
.
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=.)' |
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).
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.