Skip to contents

Get plot of fit and forecasted counts

Usage

get_plot_forecasted_counts(
  draws,
  count_data_eval,
  count_data_eval_col_name,
  forecast_date,
  count_type = "hospital admissions",
  n_draws_to_plot = 100
)

Arguments

draws

A dataframe containing the posterior draws with the data joined to it. This is the draws_df output of a call to wwinference(). It expects the following column names: date, pred_value, draw, and name

count_data_eval

A dataframe containing the count data we will evaluate the forecasts against. Must contain the columns date and a column indicating the count data to evaluate against, with the name of that column specified as the count_data_eval_col_name

count_data_eval_col_name

string indicating the name of the count data to evaluate against the forecasted count data

forecast_date

A string indicating the date we made the forecast, for plotting, in ISO8601 format YYYY-MM-DD

count_type

A string indicating what data the counts refer to, default is hospital admissions

n_draws_to_plot

An integer indicating how many draws from the posterior to include in the plot, default is 100

Value

A ggplot object containing the posterior draw of the estimated, nowcasted, and forecasted counts alongside the data used to calibrate the model and subsequently observed counts (if any) against which to evaluate the forecast performance.