Skip to contents

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_process_for_testing(
  num_steps = 10,
  num_delays = 8,
  num_strata = 2,
  initial_day = NULL,
  initial_n = 100,
  dist = c("NegativeBinomial", "Poisson"),
  units = c("daily", "weekly"),
  priors = set_priors()
)

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.

initial_n

Real. The initial expected average value of cases.

dist

Distribution. Either "NegativeBinomial" or "Poisson"

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)

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_process_for_testing(num_steps = 20, num_delays = 5, num_strata = 3)
#> ! This function will disappear in future versions please call `simulate_disease`
#>  Computing a nowcast for 2024-09-16 per "days"
#>  Assuming data is count-data where counts are in column `n`. To change this set `data_type = "linelist"`
#> ! Some values of lambda have been truncated as they are too large. This might be attributed
#> to a high variance of your data or on the prior. Consider reducing the prior variance.
#> # A tibble: 300 × 4
#>        n .strata onset_date report_date
#>    <dbl> <chr>   <date>     <date>     
#>  1   100 s1      2024-08-29 2024-08-29 
#>  2   100 s1      2024-08-30 2024-08-30 
#>  3   100 s1      2024-08-31 2024-08-31 
#>  4   100 s1      2024-09-01 2024-09-01 
#>  5   100 s1      2024-09-02 2024-09-02 
#>  6   100 s1      2024-09-03 2024-09-03 
#>  7   100 s1      2024-09-04 2024-09-04 
#>  8   100 s1      2024-09-05 2024-09-05 
#>  9   100 s1      2024-09-06 2024-09-06 
#> 10   100 s1      2024-09-07 2024-09-07 
#> # ℹ 290 more rows