fitIncidence: Fit incidence

Description Usage Arguments Value Author(s)

View source: R/fitIncidence.R

Description

Fits a given incidence curve. Fits R0, generation time, seed infections, and prior immunity fractions (1 for each age group). Uses a model from the flumodels package. All parameters that are provided as a list are presumed to be something to fit. The list can be of either length two with the first list entry should be the low and the second list entry the high or of length three, where the first list entry is the low, the second is the start value for the fit, and the third is the high value. If no start value is provided, the start value for the fit is taken to be the average of the low and high values.

The only difference in parameters between this and the SEIRModel-family is that latentPeriod and infectiousPeriod are re-defined as generationTime and latentPercent. It is expected that a fit may fix latentPercent and then allow generationTime to vary rather than fitting both latent and infectious periods.

Only the required parameters from SEIRModel are listed below. Please see SEIRModel and the other models from flumodels for a full list of parameters.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
fitIncidence(
  incidence,
  population,
  populationFractions,
  contactMatrix,
  R0,
  generationTime,
  latentPercent,
  seedInfections = 1,
  method = "L-BFGS-B",
  seedWeeksBeforeIncidence = 0,
  attackRatesToMatch,
  symptomaticIncidence = FALSE,
  fractionSymptomatic = 0.5,
  weightIncidenceTimeseries = 1,
  weightAttackRates = 1,
  weightOverallAttackRate = 10,
  ...
)

Arguments

incidence

Data frame of weekly incidence. Columns are week & incidence, corresponding to week number [0-53] & incidence in population. Not applicable as a fit parameter. Incidence is overall, not broken down by population group.

population

Size of population; defaults to 1

populationFractions

Vector of population fractions (all non-negative, sum to 1); defaults to 1, representing a single population group

contactMatrix

A matrix whose (row i, column j) entry denotes the number of potentially infectious contacts a single individual from group j has with individuals from group i each day; defaults to proportional mixing

R0

Average number of secondary cases from a single infected individual in a completely susceptible population; must be specified

generationTime

Generation time in days; must be specified.

latentPercent

Percent of total generation time spent in the latent period; must be specified.

seedInfections

Number of infections to seed the outbreak with; must be specified and greater than 0.

method

Optimiziation method. Options are L-BFGS-B from optim or any other from the list available in optim (which will cause the alabama package's constrOptim.nl method to be called). Not applicable as a fit parameter. Defaults to L-BFGS-B.

seedWeeksBeforeIncidence

Weeks before the start of the supplied incidence curve to seed initial infections. Integer. Defaults to 0.

attackRatesToMatch

Population-group specific attack rates to match. Not applicable as a fit parameter.

symptomaticIncidence

Is the incidence serological or symptomatic. Defaults to false (serological).

fractionSymptomatic

The fraction of cases that are symptomatic. Not a parameter to fit. Only used if symptomaticIncidence is set to true. Defaults to 0.5.

weightIncidenceTimeseries

What relative weight to the penalty function should the incidence timeseries receive? Defaults to 1.

weightAttackRates

What relative weight to the penalty function should the age-specific attack rates receive? Defaults to 1.

weightOverallAttackRate

What relative weight to the penalty function should the overall attack rate receive? Defaults to 10.

...

Any other parameter to pass to a flumodel. Any of these may be specified as a list and thus fit. The parameters specified (vaccine, 2-dose vaccine, antiviral, etc.) will determine the type of flumodel used.

Value

A fitIncidence object

Author(s)

Matt Clay <clay.matt@gmail.com>


HHS/ASPR-flumodelsutil documentation built on Dec. 31, 2020, 12:58 p.m.