Package 'qrensemble'

Title: Forecast ensembles using Quantile Regression Average (QRA)
Description: Performs quantile regression average
Authors: Sebastian Funk [aut, cre] , Sam Abbott [aut]
Maintainer: Sebastian Funk <[email protected]>
License: MIT + file LICENSE.md
Version: 0.1.3
Built: 2024-11-06 15:21:38 UTC
Source: https://github.com/epiforecasts/qrensemble

Help Index


Quantile Regression Average Calculates a quantile regression average for forecasts.

Description

Quantile Regression Average Calculates a quantile regression average for forecasts.

Usage

qra(
  forecast,
  target,
  group = c(),
  model = "Quantile Regression Average",
  per_quantile_weights = FALSE,
  enforce_normalisation = TRUE,
  intercept = FALSE,
  noncross = TRUE,
  ...
)

Arguments

forecast

a data.table representing forecast; this is expected to have been created using scoringutils::as_forecast_quantile()

target

the target for which to create the quantile regression average. This should be given as a vector of form column = target, where target is the value of column that represents the target. Note that the column named here cannot be a grouping variable.

group

any columns wihch to group a vector of character vectors (e.g., "horizon", "geography_scale", etc.) indicating columns in the forecasts and data data frames; by default, will not group anything, i.e. create one ensemble model

model

the name of the model to return; default: "Quantile Regression Average"

per_quantile_weights

logical; whether to estimate weights per quantile

enforce_normalisation

logical; whether to enforce quantiles

intercept

logical; whether to estimate and intercept

noncross

logical; whether ot enforce non-crosssing of quantiles

...

passed to quantgen::predict.quantile_ensemble(); of particular interest might be setting iso = TRUE for isotonic regression

Value

a data.table representing the forecasts forecast, but with model set to the value of the 'model parameter. This will be in the forecast format produced by scoringutils::as_forecast_quantile()

Examples

library("scoringutils")
example_quantile |>
  as_forecast_quantile() |>
  qra(
    group = c("target_type", "location", "location_name"),
    target = c(target_end_date = "2021-07-24")
  )