Skip to contents

Fit model for evaluation

Usage

eval_fit(
  forecast_date,
  location,
  model,
  scenario,
  hosp_data_dir,
  ww_data_dir,
  ww_data_mapping,
  scenario_dir,
  calibration_time,
  forecast_horizon,
  params_path,
  raw_output_dir,
  seed,
  iter_sampling,
  n_chains,
  adapt_delta,
  max_treedepth,
  table_of_exclusions = NULL
)

Arguments

forecast_date

As-of date for the forecast.

location

Location to forecast.

model

Model to fit. One of "ww" and "hosp"

scenario

Wastewater data availability scenario to analyze.

hosp_data_dir

Path to a directory containing vintaged hospital admissions data in date-stamped .csv files.

ww_data_dir

Path to a directory containing vintaged wastewater data in date-stamped .csv files.

ww_data_mapping

String associating forecast dates to wastewater vintage dates. Passed to date_of_ww_data().

scenario_dir

Path to a directory containing .csv files that define wastewater data availability scenarios.

calibration_time

Days of prior admissions and wastewater data to which to fit the model relative to the forecast_date.

forecast_horizon

Days forward to forecast relative to the forecast_date.

params_path

Path to a params.toml file that gives values for prior hyperparameters.

raw_output_dir

Path to a directory in which to save raw output as serialized .rds files.

seed

Seed for Stan's pseudorandom number generator.

iter_sampling

Number of samples to draw per MCMC chain.

n_chains

Number of MCMC chains to run.

adapt_delta

Target acceptance probability for the No-U-Turn sampler adaptation phase.

max_treedepth

Maximum tree depth for the No-U-Turn sampler.

table_of_exclusions

Table of outlying hospital admissions datapoints to exclude. If NULL, exclude nothing. Default NULL.

Value

NULL, saving the pre-processed data and model fitting output to disk as side effects.