Get epidemic phases from R(t)
Source:R/get_epidemic_phases_from_rt.R
get_epidemic_phases_from_rt.Rd
This function loads in the posterior estimate of the retrospective R(t) from NNH. Then it categorizes each week into an epidemic phase based on the algorithm used in https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011200 #nolint in the S5 appendix. Code available here: https://github.com/cdcepi/Evaluation-of-case-forecasts-submitted-to-COVID19-Forecast-Hub/blob/b3c379dfd48e8c673f67996014f151ce44cbd8fa/Code/Supplement%205_Rt_Epi%20Phases.R #nolint
Usage
get_epidemic_phases_from_rt(
locations,
retro_rt_path,
location_col_name = "state_abb",
prob_threshold = 0.9
)
Arguments
- locations
A vector of the state abbreviations
- retro_rt_path
A path to the parquet file of retrospective R(t) estimates
- location_col_name
A string indicating the name of the column indicating location, default is
state_abb
- prob_threshold
A numeric between 0 and 1 that defines the threshold probability R(t) >= 1 or R(t) <= 1. Default is
0.9
from the above paper.