The function selectChains
is used to discard 'bad' MCMC chains from
outbreaker's ouptput (functions outbreaker
and
outbreaker.parallel
). This is useful whenever several chains were run
and converged towards different posterior modes or distributions. This can
happen for instance when imported cases are hard to disentangle, resulting
in different runs identifying different imports and therefore having
different likelihood.
selectChains(x, select = "visual", alpha = 0.001, ...)
the output of outbreaker
or outbreaker.parallel
.
a character string matching visual
or auto
, or a
vector of integers indicating the runs to be discarded.
the alpha threshold to be used to the automatic procedure (see details)
further arguments to be passed to plotChains
.
These functions similar objects to the inputs, from which 'bad' runs have been discarded.
Three modes are available, depending on the argument select
(see also
arguments below):
visual
: (default) interactive mode
plotting the log-posterior values for the different chains and asking the
user to identify runs to be discarded.
auto
: an automatic
procedure is used to discard 'bad' runs; see details.
[numbers]
: numbers indicating the runs to be discarded.
The automatic procedure relies on the following recursive process:
1. Make the ANOVA of the log-posterior values as a function of the run identifier.
2a. If the P-value is greater than alpha (non-significant), exit.
2b. Otherwise, discard the run with the lowest mean log-posterior value, and go back to 1.