Compare observed and modelled data from the carehomes model. This conforms to the mcstate interface.

carehomes_compare(state, prev_state, observed, pars)

Arguments

state

State vector for the end of the current day. This is assumed to be filtered following carehomes_index() so contains 10 rows corresponding to ICU, general beds, admissions, deaths and seroconversion compartments.

prev_state

State vector for the end of the previous day, as for state.

observed

Observed data. This will be a list with elements icu (number of ICU beds occupied), general (number of general beds occupied), deaths_hosp (cumulative deaths in hospital settings), deaths_comm (cumulative deaths in community settings), deaths (combined deaths - used by some nations - if given then deaths_hosp and deaths_comm must be NA), admitted (hospital admissions), new (new cases), npos_15_64 (number of people seropositive in ages 15-64) and ntot_15_64 (number of people tested in ages 15-64), pillar2_pos (number of pillar 2 positives), pillar2_tot (number of pillar 2 tests)

pars

A list of parameters, as created by carehomes_parameters()

Value

A vector of log likelihoods, the same length as the number of particles (the number of columns in the modelled state)