ryantibs / quantgen

Tools for generalized quantile modeling
https://ryantibs.github.io/quantgen
14 stars 9 forks source link

quantgen

The quantgen package provides tools for generalized quantile modeling: regularized quantile regression (with generalized lasso penalties and noncrossing constraints), cross-validation, quantile extrapolation, and quantile ensembles.

Its original goal was to support the development of Delphi's COVID forecasts, and the development an ensemble forecaster out of individual component models submitted to the COVID Forecast Hub. The latter is a collaborative repo organized by the Reich lab, containing COVID forecasts from many groups (visualized here), and serves as the official data source behind the CDC's reports on COVID forecasting.

Summary of package tools

The R package quantgen provides:

Consult the package documentation and vignettes for full details.

Linear program solvers

All quantile regression and stacking problems are reformulated as linear programs (LPs), and solved using one of two LP solvers:

  1. GLPK, the default, which is open-source, and available thorugh the Rglpk package.

  2. Gurobi, which is not open-source but free for academic use, and available through the gurobi package (see below).

If at all possible, Gurobi should be used because it is much faster and more stable. The mathematical details for how these LPs are formed are given in the notebooks linked below.

Example notebooks

Beyond the vignettes, for examples in the form of R notebooks, see:

Install the quantgen R package

To install the quantgen R package directly from GitHub, run the following in R:

devtools::install_github(repo="ryantibs/quantgen", subdir="quantgen")

Install the gurobi R package