get_samps {epidemia}R Documentation

Retrieve final states from sampled Markov chains


get_samps can be used to randomly select states from a fitted model object of class epimodel. The object must have been fit using Markov chain Monte Carlo, i.e. using algorithm = "sampling" in the call to epim. The states are sampled uniformly at random without replacement, across all chains and not including the warmup period.


get_samps(prefit, n)



An object of class epimodel. This object must have been fit using algorithm = "sampling".


A positive integer. This specifies the number of states to sample.


This function can be used to specify the initial state for sampling based on states from another sampling run. This is particularly useful, for example, when you wish to fit a model using pop_adjust = T, as this makes the posterior geometry difficult to explore. Using a "prefit" run with pop_adjust = F is useful for finding good states that can be used as initial states for the run with the population adjustment.


A list of length n. Each element in the list is itself a named list, with elements corresponding to sample parameters. The result can be passed directly as the init argument in epim.

[Package epidemia version 1.0.0 Index]