This function simulates a state-space process for testing purposes in a model with multiple delays and strata. It estimates the process over a specified number of steps, with options for trend degrees, priors, and error distributions.
Usage
simulate_disease(
num_steps = 10,
num_delays = 8,
num_strata = 2,
initial_day = NULL,
warmup_steps = 50,
units = c("daily", "weekly"),
priors = random_priors(has_cycle = FALSE),
autoregresive = AR(),
moving_average = MA(),
...
)
Arguments
- num_steps
Integer. Number of time steps to simulate. Default is 10.
- num_delays
Integer. Number of delay strata. Default is 8.
- num_strata
Integer. Number of strata for the population. Default is 2.
- initial_day
Date. If the simulation is to start on a specific day.
- warmup_steps
Initial steps on model (to discard)
- units
Either
"daily"
(default) or"weekly"
.- priors
A list of all of the nowcast priors. You can use
set_priors()
to change the priors of the function (see details)- autoregresive
An
AR()
object with the autoregresive components for the epidemic and delay processes.- moving_average
A
MA()
object with the moving average component for the epidemic and delay processes.- ...
Additional arguments to pass to
nowcast()
Value
A tibble with simulated state-space process results, including the onset and report dates, strata, delays, and the number of observed cases per time step.
Examples
# Simulate a disease for 20 time steps with delay of maximum 10 and 3 strata
set.seed(48672)
sims <- simulate_disease(num_steps = 20, num_delays = 3, num_strata = 3)