Compare observed and modelled data from the basic model. This conforms to the mcstate interface.
basic_compare(state, prev_state, observed, pars)
| state | State vector for the end of the current day. This is
assumed to be filtered following |
|---|---|
| prev_state | State vector for the end of the previous day, as
for |
| observed | Observed data. This will be a list with elements
|
| pars | A list of parameters, as created by
|
A vector of log likelihoods, the same length as the number of particles (the number of columns in the modelled state)
state <- rbind(icu = 10:15, deaths = 1:6) prev_state <- matrix(1, 2, 6, dimnames = dimnames(state)) observed <- list(icu = 13, deaths = 3) pars <- basic_parameters(sircovid_date("2020-02-07"), "england") basic_compare(state, prev_state, observed, pars)#> [1] -47.303412 -6.147741 -5.399510 -5.237661 -5.252074 -5.336899basic_compare(state * 5, prev_state, observed, pars)#> [1] -6.315318 -6.974462 -7.622200 -8.171863 -8.644335 -9.058637