update.FluHMM: Generate posterior samples from a 'FluHMM' object

Description Usage Arguments Details Value

Description

This function generates new posterior samples from a ‘FluHMM’ object, or runs more iterations to increase the length of the existing ones.

Usage

1
2
3
## S3 method for class 'FluHMM'
update(x, iter = 5000, thin = 1, Rhat = 1.1,
  enlarge = FALSE)

Arguments

x

An object of class ‘FluHMM’, from which to generate posterior samples.

iter

Number of iterations to run

thin

Thinning interval between consequtive iterations to keep.

Rhat

Gelman-Rubin diagnostic cutoff value to determine convergence.

enlarge

If FALSE (the default), a new posterior sample is generated and the old one discarded. If TRUE, the new posterior sample is appended to the old one to increase its size. If you do that you must make sure you use the same thinning interval.

Details

After reaching initial convergence (i.e. convergence for the sigma[1] parameter, which is the standard deviation of the pre- and post-epidemic phases), update should be run to generate a fresh posterior sample, for as many iterations as required based on the desired level of precision.

Afterwards, convergence should be checked by examining the converged and gelman elements of the FluHMM object. If the chains have not converged, update should be run again (or alternatively autoUpdate). However, parameters beta[2] and beta[3] (the slopes of the epidemic growth and epidemic decline phases) are naturally slow-mixing and thus convergence may take longer to achieve. If all other parameters have converged (i.e. the Gelman-Rubin statistic is below 1.1) but beta[2] and beta[3] have not, it is recommended to *extend* the sample by running update with option enlarge=TRUE.

Value

None. The function mutates its argument ‘x’ directly.


thlytras/FluHMM documentation built on May 31, 2019, 10:44 a.m.