Description Usage Arguments Value
View source: R/trajectories_to_binned_distributions.R
Convert a matrix of sampled trajectories to binned distributions for short-term and/or seasonal targets.
1 2 3 4 5 6 7 8 9 10 | trajectories_to_binned_distributions(
trajectories,
targets,
h_max,
bins,
baseline,
season_start_ew,
season_end_ew,
cdc_report_ew
)
|
trajectories |
matrix of simulated trajectories. Each row is one simulated trajectory, each column is one time point. Must contain all time points needed to calculate seasonal and short-term targets |
h_max |
largest horizon for short-term targets |
targets: |
character vector specifying targets to compute. May include: "wk ahead", "Below baseline for 3 weeks", "First week below baseline", "Peak height", "Peak week" |
bins: |
vector of start and end points for incidence targets. For example: c(seq(from = 0.0, to = 25.0, by = 0.1), 100.0) |
baseline: |
baseline for this unit, if applicable; required if "onset timing", "Below baseline for 3 weeks", or "First week below baseline" are among the targets to forecast |
season_start_ew: |
character specification of season start epidemic week, formatted as "2019-EW40" |
season_end_ew: |
character specification of season end epidemic week, formatted as "2020-EW20" |
cdc_report_ew: |
character specification of epidemic week corresponding to most recent cdc report, formatted as "2019-EW40" |
data frame with columns: target: with values coming from targets type: populated with "Bin" bin: name of bin for categorical targets, lower endpoint of bin for numeric targets value: proportion of trajectories falling in bin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.