fit_filter: Fit a Bayesian filter over time

Description Usage Arguments Details

View source: R/bayes-filter.R

Description

This function calls bayesian_filter repeatedly to fit an evolving set of parameters to a dataset. The result is organized into a table of model state and parameters over time.

Usage

1
2
3
4
5
6
7
8
9
fit_filter(
  initstates,
  obsdata,
  tinit,
  tfinal,
  hospdata = NULL,
  history = TRUE,
  ids = NULL
)

Arguments

initstates

Matrix containing ensemble of initial states and parameter values (see description in bayesian_filter.

obsdata

Observed data to use in the fit

tinit

Initial time corresponding to the states provided in initstates

hospdata

Hospitalization data to use in the fit.

history

Detailed history for the individual ensemble members (see details).

ids

List of serial numbers for the ensemble members. This is only used if we are keeping history. See details for why you might want to specify this explicitly.

tfin

Final time (i.e., the time of the last observation to use in fitting the filter)

Details

The history argument allows us to optionally keep detailed histories for the individual ensemble members, including beta, imports, I, Is, and Itot. Otherwise, the only history you get is is summary statistics (median and 95 either pass in the history output from a previous run (the new history will be appended), or if earlier history is not available, set to any non-null value (the new history will be returned).

If history is being kept, then we need to assign serial numbers to the ensemble members. By default, these are assigned sequentially, but there are reasons why they might need to be specified explicitly. One is if the ensemble matrix is reordered for some reason. The other is if some ensemble members are dropped or replaced.


rplzzz/CovMitigation documentation built on June 7, 2021, 8:48 a.m.