Skip to contents

Plot of draws for a single forecast date, with optional groupings

Usage

get_plot_draws(
  df,
  y,
  figure_file_path,
  log_scale = FALSE,
  grouping_var = NA,
  from_full_df = FALSE,
  days_pre_forecast_date_plot = 90,
  write_files = TRUE,
  show_calibration_data = FALSE,
  show_median = FALSE
)

Arguments

df

dataframe either containing filepaths to load in model draws or dataframe of model draws with data. Expected columns are: name, t, value, draw, include_ww, forecast_date, hosp_reporting_delay, location, date, daily_hosp_admits, daily_hosp_admits_for_eval, obs_data, period, model_type

y

outcome variable for the y-axis of plots, options are 'pred_hosp' and 'pred_ww'

figure_file_path

directory to save the figure

log_scale

whether or not to transform the y-axis to log scale, default is FALSE

grouping_var

what to group by, default is NA, options are 'model_type' and 'location'

from_full_df

if TRUE, df is a draws dataframe, if FALSE, df is a data frame of filepaths

days_pre_forecast_date_plot

how many days to show the calibration data default is 90

write_files

whether or not to write files to the path, default is TRUE

show_calibration_data

whether or not to show the data the model was calibrated to, which might be different from the eval data. Default is false

show_median

whether or not to show the median across all draws, default is false

Value

plot object