Description Usage Arguments Details Value
This function runs further MCMC iteration to extend the current posterior sample until convergence is reached for all parameters.
1 | autoUpdate(x, iter = 20000, maxit = 2e+05, Rhat = 1.1, thin = 1)
|
x |
An object of class ‘FluHMM’, from which to generate posterior samples. |
iter |
Number of iterations to run. |
maxit |
Maximum number of iterations to run before giving up. |
Rhat |
Gelman-Rubin diagnostic cutoff value to determine convergence (only for the sigma[1] parameter). |
thin |
Thinning interval. If the beta[2] and beta[3] parameters are very slow to mix,
and your RAM memory is insufficient, it is advisable to use a larger thinning interval
(e.g. 10 or 50), i.e. keep in the posterior sample every |
Most parameters in the model converge fairly quickly, but mixing is slower for parameters
beta[2] and beta[3] (i.e. the slopes of the epidemic growth and epidemic decline phases). Initial
convergence of the model is judged by monitoring the sigma[1] parameter and is performed by the
function autoInitConv
, which is usually run in the FluHMM
constructor.
If all other parameters have converged but beta[2] and beta[3] have not, due to slow mixing, then
it is advisable to run the MCMC chain for longer, until beta[2] and beta[3] cover their posterior
distributions adequately. This can be done manually using update
with argument
enlarge=TRUE
. Alternatively autoUpdate
can be used, which extends the sample by
iter
iterations, checks the Gelman-Rubin diagnostic for all parameters, and if convergence
has not been reached it extends again the sample until convergence or until maxit
iterations.
In some cases (usually near the end of the influenza surveillance period, when all five model phases have occured) mixing is very slow and the chains need to be run for very long. This requires lots of RAM memory and a fair amount of CPU power to handle the very large posterior sample. In such cases it is advisable to thin the chain (i.e. by 10 or 20, i.e. keep every 10th or 20th element in the MCMC chain), to generate a smaller posterior sample with good coverage of the posterior distribution.
None. The function mutates its argument ‘x’ directly.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.