Compare observed and modelled data from the basic model. This conforms to the mcstate interface.
basic_compare(state, observed, pars)
State vector for the end of the current day. This is
assumed to be filtered following basic_index()
so contains
rows corresponding to ICU and deaths.
Observed data. This will be a list with elements
icu
(number of ICU beds occupied) and deaths
(number of
deaths over this day).
A list of parameters, as created by
basic_parameters()
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_inc = 1:6)
observed <- list(icu = 13, deaths = 3)
pars <- basic_parameters(sircovid_date("2020-02-07"), "england")
basic_compare(state, observed, pars)
#> [1] -6.196169 -5.427647 -5.250788 -5.253934 -5.330205 -5.440127
basic_compare(state * 5, observed, pars)
#> [1] -6.393449 -7.085959 -7.714697 -8.248429 -8.709151 -9.114669