Skip to contents

All functions

add_horizons()
Add columns indicating the horizon to forecasts or scores
assert_needed_env_vars()
Assert that needed environment variables are set
benchmark_performance()
Benchmark performance of wastewater and hospital admissions model foreast runs
check_any_flags()
Check whether a model run had any flags.
clean_and_filter_nwss_data()
Initial subsetting of NWSS data
clean_flag_df()
Clean flags from a real-time forecast
clean_ww_data()
Clean wastewater data
combine_and_summarize_ww_data()
Combine and summarize wastewater data across all forecast dates and locations
combine_hub_and_local_wis()
Combine the hosp only real-time scores and cfa real- time scores from github
combine_outputs()
Combine outputs
compose_example_scores_fig()
Compose figure showing examples of forecasts and their scores.
compose_hub_fig()
Functions for creating multi-panel composite figures Make a figure showing comparisons between CFA models and other COVIDHub models
compose_pred_actual_fig()
Compose figure showing predictions and observations for three example forecasts.
compose_rel_performance_fig()
Make a multi-panel figure summarizing relative performance.
compute_flags()
Compute diagnostic flags from raw stanfit objects
compute_forecast_difference()
Compute the the posterior of the difference between model predictions.
create_hub_submissions()
Create hub submission files
create_mock_submission_scores()
Create mock submission scores
date_of_ww_data()
Date of wastewater data
density_plot_std_rank()
Make a figure of the distribution of standardized WIS rank
.relative_metric_display_name()
Internal function for display names of relative metrics
eval_fit()
Fit model for evaluation
eval_postprocess()
Postprocess model for evaluation.
exclude_hosp_outliers()
Exclude hospital outliers
fit_hosp_trend()
Fit a hosp trend with BRMS
fit_recent_trends()
Fit recent hospital admission and wastewater trends using BRMS
fit_ww_trend()
Fit lab-site-level recent wastewater trends with BRMS.
flusight_location_table
flusight_location_table dataset
forecast_interval_coverage_plot()
Plot interval coverage at specified ranges
forecast_output_path()
Standard path to an output directory for a specific forecast
forecast_qq_plot()
Functions for plots that assess forecast calibration Get quantile-quantile plot
format_for_hub()
Format quantiles for the current COVID Forecast Hub
format_scores_for_comparison()
Format the hosp only real time scores for comparison to the other real time models
geom_decomposed_scores()
Composite geometric object for barplots of scores decomposed into undeprediction, overprediction, and dispersion components
get_add_ww_metadata()
Get additional wastewater metadata
get_box_plot()
Get box plot by date and scenario
get_convergence_df()
Get convergence dataframe
get_date_locs_excluded()
Get forecast date locations that we excluded in the model run
get_diagnostic_flags()
Get diagnostic flags
get_epidemic_phases_from_rt()
Get epidemic phases from R(t)
get_filepath()
Get filepath
get_growth_rate_plot()
Compare growth rates in wastewater and hospital admissions data
get_heatmap_metadata()
Get a heatmap of the metadata of reasons for excluding forecasts from analysis
get_heatmap_metadata_hub()
Get a heatmap of the metadata of Hub models submitted
get_heatmap_scores()
Get heatmap of scores by scenario
get_ind_forecast_score()
Get an individual forecast score summary for a particular forecast date and location
get_input_hosp_data()
Get input hospital admissions data
get_input_ww_data()
Get input wastewater data
get_last_hosp_data_date()
Get last hospital admissions data point date
get_last_hosp_data_date_map()
Get a map of the location, forecast date, and last hospital admissions data date
get_model_draws_w_data()
Get model draws combined with input and evaluation data
get_model_path()
Get model path
get_n_states_improved_plot()
Get bar chart of the number of states improved compared to without wastewater over each forecast date
get_object_loader()
Generate a function for loading raw output objects for a location/forecast date/scenario trio.
get_object_saver()
Generate a function for saving raw output objects for a location/forecast date/scenario trio.
get_plot_bias_over_time()
Get a plot of bias over time
get_plot_hosp_data_comparison()
Get plot of hospital admissions data compared to model draws
get_plot_quantile_comparison()
Get plot quantile comparison
get_plot_raw_scores()
Get plot raw scores
get_plot_score_by_horizon_t()
Get plot of scores by horizon over time
get_plot_scores_and_forecasts()
Got a plot of forecasts and scores for a single location and date
get_plot_scores_w_data()
Get plot scores with evaluation data overlaid
get_plot_sites_vs_performance()
Make a scatterplot comparing number of wastewater sites to model performance.
get_plot_summarized_scores()
Get plot summarized scores
get_plot_theme()
Get standardized plot theme to add to figures
get_plot_ww_data()
Plot wastewater evaluation data
get_plot_ww_data_comparison()
Get plot of wastewater data compared to model draws
get_raw_output_suffix()
Generate a standard-format output suffix for saving raw output for a location/forecast date/scenario trio.
get_rel_wis_all_time()
Get the relative wis from the hub formatted
get_rel_wis_real_time()
Get the relative wis for the real time scores
get_scenario_site_ids()
Get scenario site ids
get_score_summary_tables()
Make a summary of the with and without wastewater comparison scores
get_state_level_quantiles()
Get quantiles for state-level generated quantities
get_state_level_ww_quantiles()
Get quantiles for site-lab level wastewater
get_stats_improved_forecasts()
Get stats on number of improved forecasts
get_summary_metadata()
Get a summary table of the number of forecasts excluded for each reason
get_summary_ww_table()
Get wastewater data summary tables
get_table_sufficient_ww()
Get table of location-forecast dates with sufficient wastewater
get_ww_data_flags()
Get table of location-forecast dates with sufficient wastewater
heatmap_scores_by_loc_date()
Plot a heatmap of avg forecast performance by location and forecast date
hub_average_score_table()
Make summary table of WIS scores in Hub models overall
load_data_and_summarize()
Load data and summarize metadata
load_real_time_forecast()
Load a real-time forecast
load_real_time_quantile_fcsts()
Load real-time quantile outputs
make_baseline_score_table()
Make baseline score table
make_df()
Make dataframe
make_fig2_ct_supp()
Make concentration fit and forecast figure for supplement
multi_location_crps_figure()
Generate bar plots of CRPS for each model in different locations
nhsn_soda_query()
Construct a Socrata open data API (SODA) query for the NSHN dataset
order_col()
Light wrapper function for converting a dataframe column to an ordered factors.
order_horizons()
Get the order of the categorical horizons for plotting
order_locations()
Get the order of the locations for plotting
order_periods()
Get the order of the time periods for plotting
order_phases()
Get the order of the categorical horizons for plotting
plot_benchmarks()
Plot benchmark summaries
plot_components()
Get plot components (colors for now)
plot_crps_underlay()
Make CRPS underlay figure
plot_forecast_comparison_t()
Compare two hospital admissions forecasts over time.
plot_heatmap_relative_wis()
Make a heatmap of relative WIS across locations
plot_hub_performance_by_period()
Get plot of overall hub performance, grouped by period
plot_model_hosp_t_comparison()
Make a plot comparing the fit and forecasted hospital admissions from the wastewater-informed and hospital admissions-only models.
plot_pred_actual_hosp()
Make a plot comparing the fit and forecasted hospital admissions from the wastewater and hospital admissions model for a few example states
plot_pred_actual_ww()
Make concentration fit and forecast figure
plot_rel_crps_by_horizon()
Make head to head CRPS distribution comparison plot for a single location
plot_rel_score_distribution()
Get a dotsinterval plot of a relative score distribution for individual location/forecast-date forecast problems.
plot_rel_score_dists()
Make a dotsinterval plot of relative scores stratified by specified variables.
plot_rel_score_dists_by_horizon()
Make figure that stratifies across location and forecast dates
plot_rel_score_heatmap()
Plot a heatmap of the relative crps by locations and forecast date for the head-to-head comparison
plot_score_decomposed_bars()
Barplot of WIS or CRPS decomposed into overprediction, underprediction, and dispersion
plot_score_scatter()
Plot a scatterplot of scores comparing those of one model to those of another, for a given stratification.
plot_score_t()
Plotting functions for absolute forecast scores Plot average score over time for model comparison
plot_scores_by_scenario()
Barplot of scores by scenario
plot_total_admissions()
Make a figure of overall admissions (summed across locations) for context
plot_ww_conc_by_site()
Make concentration fit and forecast figure
postprocess_successful_fit()
Postprocess a successful eval fitting job.
process_recent_trend_fits()
Process BRMS log-linear fits of recent trends
pull_and_write_hosp_data()
Pull and save the current state of NHSN data on HealthData.gov
pull_daily_nhsn()
Pull daily NHSN data from HealthData.gov
pull_hub_forecasts()
Pull hub submissions and create a scorable table as the output of scoringutils::as_forecast_quantile().
quantile_metrics
Metrics to use for quantile scores
query_and_select_models()
Query Zoltar for models to include in the analysis
read_rds_with_suffix()
Load an object from an .rds serialized file in a given output_dir, with programmatic naming.
relative_wis_histogram()
Plot a histogram of individual forecast relative WIS values
sample_metrics
Metrics to use for quantile scores
save_rds_with_suffix()
Save an object to .rds in a given dir, with programmatic naming.
save_table()
Save table
scale_alpha_score_component()
ggplot scale for fill alphas by name of WIS/CRPS score component.
scale_fill_model() scale_color_model()
ggplot discrete scales for forecast models
score_hub_forecasts()
Score hub forecasts
score_quantiles()
Get the scores for every day for a location, forecast date, and scenario from the quantiles during the forecast period
score_real_time_outputs()
Load in and score the real-time outputs
score_samples()
Get the scores for every day for a particular location and forecast date
select_like()
Select columns from one dataframe based on the column spec of a second dataframe
soql_is_in()
Return a soql::soql_where() construct for a given column being in a list of values
summarize_std_rank()
Summarize standardize rank with medians and 25th,75th percentiles
three_location_forecast_fig()
Make a figure showing three example hospital admissions forecast timeseries and associated wastewater concentration timeseries.
with_dependencies()
Helper function to note targets dependencies not explicitly noted in the function call