Skip to main content
QUICK REVIEW

[Paper Review] qgam: Bayesian non-parametric quantile regression modelling in R

Matteo Fasiolo, Simon N. Wood|arXiv (Cornell University)|Jul 7, 2020
Statistical Methods and InferenceMathematics23 references6 citations
TL;DR

This paper introduces the qgam R package for fast, calibrated Bayesian quantile regression using generalized additive models (GAMs), enabling non-parametric estimation of conditional quantiles without assuming a parametric response distribution. By smoothing the pinball loss and using calibrated Bayesian inference with information kernel learning (IKL) for tuning, qgam achieves accurate quantile estimates and well-calibrated credible intervals, outperforming MCMC and boosting methods in coverage and computational efficiency.

ABSTRACT

Generalized additive models (GAMs) are flexible non-linear regression models, which can be fitted efficiently using the approximate Bayesian methods provided by the mgcv R package. While the GAM methods provided by mgcv are based on the assumption that the response distribution is modelled parametrically, here we discuss more flexible methods that do not entail any parametric assumption. In particular, this article introduces the qgam package, which is an extension of mgcv providing fast calibrated Bayesian methods for fitting quantile GAMs (QGAMs) in R. QGAMs are based on a smooth version of the pinball loss of Koenker (2005), rather than on a likelihood function, hence jointly achieving satisfactory accuracy of the quantile point estimates and coverage of the corresponding credible intervals requires adopting the specialized Bayesian fitting framework of Fasiolo, Wood, Zaffran, Nedellec, and Goude (2020b). Here we detail how this framework is implemented in qgam and we provide examples illustrating how the package should be used in practice.

Motivation & Objective

  • To develop a scalable, fast method for fitting quantile additive models (QGAMs) in R without assuming a parametric distribution for the response variable.
  • To address the challenge of achieving proper frequentist coverage of credible intervals in Bayesian quantile regression, especially for tail quantiles.
  • To extend the mgcv package with a new framework that supports fast, calibrated Bayesian inference for QGAMs using smoothed loss functions and efficient optimization.
  • To provide a practical R tool that enables researchers to fit, visualize, and validate QGAMs with marginal likelihood and empirical Bayes methods.

Proposed method

  • The method uses a smoothed version of the pinball loss function to enable efficient optimization, replacing the standard likelihood-based approach.
  • It applies calibrated Bayesian inference via the information kernel learning (IKL) framework to select the optimal learning rate, ensuring near-nominal coverage of credible intervals.
  • The regression coefficients are estimated using maximum a posteriori (MAP) optimization on a smoothed loss, while hyper-parameters are selected via empirical Bayes using marginal likelihood.
  • The framework leverages existing mgcv tools for smooth term construction, including cyclic, adaptive, and tensor-product splines, enabling flexible model specification.
  • The method avoids MCMC by using direct optimization, significantly improving computational speed compared to existing Bayesian or boosting alternatives.
  • Model fitting is implemented via a new R package, qgam, which integrates with mgcv and supports model checking, prediction, and diagnostic tools.

Experimental results

Research questions

  • RQ1Can a fast, calibrated Bayesian framework be developed for quantile additive models that avoids parametric assumptions on the response distribution?
  • RQ2How can credible intervals in Bayesian quantile regression achieve proper frequentist coverage, especially for extreme quantiles?
  • RQ3Can the computational burden of Bayesian quantile regression be reduced while maintaining accuracy and calibration?
  • RQ4How does the performance of qgam compare to existing methods like MCMC, boosting, or quantreg in terms of estimation accuracy and interval coverage?

Key findings

  • The qgam package successfully implements a fast, calibrated Bayesian framework for QGAMs, achieving near-nominal coverage of credible intervals across all quantiles, including extreme ones.
  • The method outperforms MCMC-based approaches in terms of computational speed and interval coverage, particularly for tail quantiles where MCMC often undercovers.
  • In a real-world electricity demand forecasting example, the functional QGAM model (fit via mqgam) achieved lower pinball loss than the standard QGAM on the test set, especially for extreme quantiles (0.1 and 0.9).
  • The effective degrees of freedom (edf) for the temperature effect were close to the maximum possible (k’), suggesting that increasing k to 20 could improve model fit for the median quantile.
  • The calibrated Bayesian framework via IKL selection of the learning rate ensures that credible intervals maintain appropriate coverage, avoiding the under-coverage issues seen in standard pseudo-likelihood approaches.
  • The package supports a wide range of smooth terms (e.g., cyclic, adaptive, tensor-product) through integration with mgcv, enabling flexible modeling of complex, non-linear relationships.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.