View source: R/qra_fit_convenience.R
build_covid_ensemble | R Documentation |
Read in covid forecasts from local files and fit one ensemble
build_covid_ensemble(
hub,
source,
hub_repo_path,
candidate_model_abbreviations_to_include,
spatial_resolution,
targets,
forecast_date,
as_of,
forecast_week_end_date,
max_horizon,
timezero_window_size = 1,
window_size,
data_as_of_date,
forecast_date_locations_drop = NULL,
target_end_date_locations_drop = NULL,
intercept = FALSE,
combine_method,
quantile_groups,
noncross = "constrain",
missingness,
impute_method,
backend,
required_quantiles,
check_missingness_by_target,
do_q10_check,
do_nondecreasing_quantile_check,
do_baseline_check,
do_sd_check,
sd_check_table_path = NULL,
sd_check_plot_path = NULL,
baseline_tol = 1.2,
max_weight = NULL,
top_models = 0,
manual_eligibility_adjust,
return_eligibility = TRUE,
return_all = TRUE,
partial_save_frequency,
partial_save_filename
)
hub |
character vector, where the first element indicates the hub from which to load forecasts. Possible options are "US" and "ECDC"; passed to covidHubUtils::load_latest_forecasts |
source |
string specifying where forecasts will be loaded from: either "local_hub_repo" or "zoltar"; passed to covidHubUtils::load_latest_forecasts |
hub_repo_path |
path to local clone of the reichlab/covid19-forecast-hub
repository to be used when |
candidate_model_abbreviations_to_include |
List of model abbreviations for models that may be included in ensemble forecast |
targets |
character vector of targets to retrieve, for example c('1 wk ahead cum death', '2 wk ahead cum death') |
forecast_date |
the forecast date for the analysis, typically a Monday |
as_of |
"as_of" date passed to zoltar
Ignored if |
forecast_week_end_date |
date relative to week-ahead or day-ahead targets are defined. For week ahead targets, a Saturday; for day ahead targets, a Monday. |
max_horizon |
maximum horizon for ensemble forecasts |
timezero_window_size |
The number of days back to go. A window size of
0 will retrieve only forecasts submitted on the |
window_size |
size of window |
data_as_of_date |
date for which observations should be current |
intercept |
logical specifying whether an intercept is included |
combine_method |
character specifying the approach to model combination: "equal", "convex", "positive", "unconstrained", "median", or "convex_median". The first four form a linear combination of quantiles across component models with varying levels of restrictions on the combination coefficients. "median" takes the median across models at each quantile level, and "convex_median" uses a weighted median with convext constraints on weights |
quantile_groups |
Vector of group labels for quantiles, having the same
length as the number of quantiles. Common labels indicate that the ensemble
weights for the corresponding quantile levels should be tied together.
Default is rep(1,length(quantiles)), which means that a common set of
ensemble weights should be used across all levels. This is the argument
|
noncross |
string specifying approach to handling quantile noncrossing: one of "constrain" or "sort". "constrain" means estimation is done subject to constraints ruling out quantile crossing. "sort" means no such constraints are imposed during estimation, but the resulting forecasts are sorted. |
missingness |
character specifying approach to handling missing forecasts: 'by_location_group', 'rescale', or 'impute' |
impute_method |
character string specifying method for imputing missing forecasts; either 'mean' for mean imputation or 'none' for no imputation |
backend |
back end used for optimization. |
required_quantiles |
numeric vector of quantiles component models are required to have submitted |
check_missingness_by_target |
if TRUE, record missingness for every combination of model, location, forecast week, and target; if FALSE, record missingness only for each model and location |
do_q10_check |
if TRUE, do q10 check |
do_nondecreasing_quantile_check |
if TRUE, do nondecreasing quantile check |
max_weight |
numeric value for maximum weight. Ignored unless qra_model is rel_wis_weighted_median or rel_wis_weighted mean and backend is grid_search |
return_eligibility |
if TRUE, return model eligibility |
data frame with ensemble forecasts by location
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.