Get the target period for a forecast date, incidence period and ahead

get_target_period(forecast_date, incidence_period, ahead)

Arguments

forecast_date

Date object or string of the form "YYYY-MM-DD", indicating date on which forecasts will be made about some period (e.g., epiweek). For example, if forecast_date = "2020-05-11", incidence_period = "day", and ahead = 3, then, we'd be making forecasts for "2020-05-14".

incidence_period

String indicating the incidence period, either "epiweek" or "day".

ahead

Vector of (one or more) integers. How many epiweeks/days ahead are you forecasting? If incidence_period = "epiweek" and forecast_date is Sunday or Monday, then ahead = 1 means the epiweek that includes the forecast date; if forecast_date falls on a Tuesday through Saturday, then it is the following epiweek. If incidence_period = "day", then ahead = 1 means the day after forecast date.