The "basic" sircovid model. This is a dust model.

Examples

# 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         224  163  142  230  230  288  209  264  138   108
#> deaths      718  511  411  734  715  850  587  891  417   335
#> deaths_inc  112   76   63  129  130  153  102  175   62    44

# 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,]      224.0      163.0      142.0      230.0      230.0      288.0
#> [4,]      718.0      511.0      411.0      734.0      715.0      850.0
#> [5,]      112.0       76.0       63.0      129.0      130.0      153.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,]      209.0      264.0      138.0      108.0
#> [4,]      587.0      891.0      417.0      335.0
#> [5,]      102.0      175.0       62.0       44.0
#> [6,]        0.1        0.1        0.1        0.1