census_model_output: Compute input for the hospital census model from a filter...

Description Usage Arguments Details Value TODO

View source: R/census-model.R

Description

Run the ensemble members for all counties and aggregate their results, weighted by market share.

Usage

1
2
3
4
5
6
7
8
census_model_output(
  fitdir,
  tfinal,
  scenario_name = "BAU",
  mktmin = 0.1,
  scenario = NULL,
  tstrt = NULL
)

Arguments

fitdir

Name of directory with saved filter fit objects

tfinal

Max run time for the projections

scenario_name

Name of the scenario. Defaults to "BAU" (business as usual).

mktmin

Market share threshold. Counties where we have a market share below the threshold will not be run.

scenario

Scenario data structure returned from Scenario. If a data frame is passed, it will be converted with a call to Scenario.

tstrt

Start of the projection period. If omitted, the projection will start at the end of the model fit. Otherwise, the projection will start at the last historical time step prior to the requested start time. Since the model fitting is done at weekly intervals, this may not be exactly equal to tstrt.

Details

If the model history is included, it will be prepended onto the projection. If not, the output will start with the projection.

The scenario structure, if present, should be a data frame that describes a schedule of hypothetical parameter changes in the future. Changes for times in the past (prior to the start of the projection) are ignored; however, the most recent such change will take effect in the first future time step. The format for the scenario structure is a data frame with the following columns:

locality

The locality the change applies to. A NA value here means the change is a default that will apply to any locality without a specified change.

time

The time at which a change in a parameter occurs. The parameter will remain at its changed value until another change is imposed.

parm

Parameter affected by the change

value

The change factor. This will be treated as a multiplier on the parameter's value at the end of the historical period. For example, a value of 1.2 will produce a 20 historical week.

Value

Data frame suitable for input into census model. All case counts are market share weighted. Columns:

date

Simulation date

time

Simulation date expressed as days since Jan 01

scenario

Ensemble member ID number

popmkt

Market share weighted population

newCases

Daily new cases

newSympto

Daily new symptomatic cases

PopSympto

Symptomatic population

PopInfection

Infected population

fracInfection

Infection prevalence. Technically this is market share weighted, but you get the same answer whether you weight by market share or not.

PopCumulInfection

Cumulative number of infections

fracCumulInfection

Cumulative fraction of population infected. This value is the same whether or not you weight by market share

TODO

* Refactor common code between this and project_filter_model. * Add options for scenarios with transmissibility changes.


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