The "basic" sircovid model. This is a dust model.
# Set up the basic model for England with default parameters and
# an initial seeding of early February:
p <- basic_parameters(sircovid_date("2020-02-07"), "england")
mod <- basic$new(p, 0, 10)
# Set the initial state and index as we would us for a run
# (without setting an initial state there is no seeding)
initial <- basic_initial(mod$info(), 10, p)
mod$update_state(state = initial)
mod$set_index(basic_index(mod$info())$run)
# Run the model up to the end of march
step_end <- sircovid_date("2020-03-31") / p$dt
# The filtered state is returned at the end of the run
mod$run(step_end)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> icu 174 197 239 106 133 138 156 127 241 248
#> deaths 553 578 729 294 434 413 471 431 759 719
#> deaths_inc 99 97 129 50 86 52 85 72 139 124
# More state can be retrieved using the "state" method
mod$state(1:6)
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 91.0 91.0 91.0 91.0 91.0 91.0
#> [2,] 56550138.0 56550138.0 56550138.0 56550138.0 56550138.0 56550138.0
#> [3,] 174.0 197.0 239.0 106.0 133.0 138.0
#> [4,] 553.0 578.0 729.0 294.0 434.0 413.0
#> [5,] 99.0 97.0 129.0 50.0 86.0 52.0
#> [6,] 0.1 0.1 0.1 0.1 0.1 0.1
#> [,7] [,8] [,9] [,10]
#> [1,] 91.0 91.0 91.0 91.0
#> [2,] 56550138.0 56550138.0 56550138.0 56550138.0
#> [3,] 156.0 127.0 241.0 248.0
#> [4,] 471.0 431.0 759.0 719.0
#> [5,] 85.0 72.0 139.0 124.0
#> [6,] 0.1 0.1 0.1 0.1