get_onset_week: Utility function to compute onset week based on a trajectory...

Description Usage Arguments Value

View source: R/utils.R

Description

Utility function to compute onset week based on a trajectory of incidence values

Usage

1
2
get_onset_week(incidence_trajectory, baseline, onset_length,
  first_season_week = 31, weeks_in_first_season_year)

Arguments

incidence_trajectory

a numeric vector with incidence for each time point in a season

baseline

the threshold that incidence must cross to count as an onset

onset_length

number of consecutive time points that incidence must exceed the baseline threshold in order to count as the season onset

first_season_week

number of weeks in year corresponding to the first week in the season. For example, our code takes this value to be 31: a new influenza season starts on the 31st week of each year.

weeks_in_first_season_year

How many MMWR weeks are in the first year of the season? For example, in the 2000/2001 season, the first year is 2000. There were 52 MMWR weeks in 2000.

Value

the smallest index i such that every entry of incidence_trajectory[seq(from = i, length = onset_length)] is >= baseline, if such an index exists. Otherwise, the character vector "none"


reichlab/2017-2018-cdc-flu-contest documentation built on May 24, 2019, 6:17 a.m.