-
Notifications
You must be signed in to change notification settings - Fork 5
Fast and Scalable Dynamic Quantile Models
Welcome! This project aims to extend and optimize the exDQLM package, a Bayesian framework for dynamic quantile regression, incorporating improvements in Variational Bayes inference, C++ acceleration, and multivariate support.
Time series modeling is crucial for forecasting in fields such as climate, economics, hydrology, and finance. Traditional methods generally focus on mean-based inference, which can be insufficient for capturing the complex dynamics of the tails of a distribution. Quantile regression offers a robust alternative by enabling analysis across the entire conditional distribution.
Bayesian dynamic quantile regression has emerged as a powerful tool, but existing software often lacks scalability, comprehensive Bayesian modeling, and efficient computational frameworks. The exDQLM package, based on the Extended Asymmetric Laplace (exAL) distribution and Dynamic Linear Models (DLMs), directly addresses these challenges by providing a fully Bayesian, state-space framework for time-varying quantile estimation.
The following table summarizes the features of existing R packages for quantile regression, highlighting how exDQLM improves upon prior approaches.
| Feature | quantreg |
dynquant |
SPQR |
qrjoint |
bayesQR |
lqr |
exDQLM |
|---|---|---|---|---|---|---|---|
| Frequentist Approach | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ |
| Bayesian Inference | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ |
| Time-Dependent Data | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Covariates | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ |
| Scalability (Large Data) | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
| Non-Linear Regression | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Multivariate Response | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
| Missing Data Handling | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| Non-Crossing Quantiles | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ |
Table Summary:
The existing methods are often limited in scope, particularly for dynamic, Bayesian, and scalable quantile estimation. While quantreg is widely used for frequentist quantile regression, it lacks Bayesian inference, dynamic updates, and non-crossing constraints. Similarly, dynquant supports time-dependent quantiles but is not Bayesian and does not allow multi-quantile synthesis. SPQR and qrjoint provide Bayesian alternatives but lack state-space modeling for temporal data.
This project will transform exDQLM into a comprehensive framework for Bayesian dynamic quantile regression, incorporating the following improivements:
| Area of Improvement | Description |
|---|---|
| Variational Bayes (VB) Inference | Implement VB inference using Laplace/Delta approximations for non-conjugate priors, enabling fast posterior updates. |
| C++ Acceleration | Utilize Rcpp and RcppParallel to develop core routines (e.g., Kalman filtering and smoothing) in C++ for superior performance. |
| Modular Design | Decompose the model into trend, seasonal, and regression components—each with its own evolution and observation matrices—then combine them into a unified state-space model. |
| Posterior Predictive Quantile Synthesis (PPQS) | Synthesize multiple quantile estimates into a coherent posterior predictive distribution while ensuring non-crossing quantiles. |
| Multivariate Extensions | Extend support to multivariate time series for joint quantile estimation across multiple responses. |
| Hyperparameter Specification | Define informative priors: inverse gamma for sigma and a truncated location–scale Student's t–distribution for gamma, with three hyperparameters. |
| Discount Factor Matrix | Implement discount factors to adaptively update the evolution covariance in the state-space model. |
| Comprehensive Testing & Documentation | Provide detailed documentation, unit tests, and vignettes to ensure reproducibility and ease of use. |
The refined exDQLM package will have a broad impact, making robust Bayesian dynamic quantile regression accessible for:
- Environmental Modeling: Enhancing forecasting accuracy for extreme weather and hydrological events.
- Finance: Better estimating tail risks and calculating Value-at-Risk (VaR) through dynamic quantile methods.
- Health Economics: Modeling treatment outcomes and cost distributions more reliably under uncertainty.
We invite experienced mentors to support this project. If you are interested in mentoring or have suggestions regarding the project, please add your details below.
| Mentor | Role | Institution | |
|---|---|---|---|
| Evaluating Mentor | |||
| Co-Mentor |
Mentors, if you would like to add yourself as well, please feel free to update this section with your details.
To apply, potential contributors should complete one or more of the following tests:
- Implement the Extended Asymmetric Laplace (exAL) distribution in C++ following Yan and Kottas (2017).
- Implement and expose the following functions to R using
Rcpp:-
dexal(x, p0, mu, sigma, gamma, log = FALSE): Density function. -
pexal(q, p0, mu, sigma, gamma, lower.tail = TRUE, log.p = FALSE): CDF function. -
qexal(p, p0, mu, sigma, gamma, lower.tail = TRUE, log.p = FALSE): Quantile function. -
rexal(n, p0, mu, sigma, gamma): Random sampling function.
-
- Ensure numerical stability and efficiency of the C++ implementation.
- Validate implementation by comparing against analytical properties.
- Implement Univariate Kalman Filtering (KF) and Kalman Smoothing (KS) algorithms in C++.
- Develop an R interface via
RcppandRcppArmadillo. - Use the implementation to fit a Normal Dynamic Linear Model (DLM).
- Compare results with the R package
dlmto validate correctness. - Optimize computation using robust matrix factorization techniques (Cholesky, QR, SVD).
- Implement an univariate Bayesian dynamic quantile regression using the exAL distribution in R via Variational Bayes (VB), following Barata et al. (2022).
- Use Laplace/Delta approximation for VB inference of non-conjugate parameters, following Wang and Blei (2012).
- Compare model performance and inference results against the R package
dynquant. - Validate posterior convergence, quantile estimates, and parameter inference accuracy.
Please post links to your GitHub test results when you contact the mentors.
| Contributor Name | GitHub Profile | Test Results |
|---|---|---|
| Antonio Aguirre | AntonioAPDL | - Easy Test: Pending - Medium Test: exAL Implementation - Hard Test: In-progress |
| Resource | Link |
|---|---|
| CRAN Package: exDQLM | exDQLM on CRAN |
| Technical Report (UCSC-SOE-21-10) | UCSC-SOE-21-10 (PDF) |
We are actively seeking motivated contributors and mentors for this project. We welcome your contributions and ideas to further refine and enhance exDQLM.
For any questions or to express interest, please get in touch with the contributor directly.
Feel free to edit this page as needed.
-
Contributor: Antonio Aguirre
- Email: [email protected] | [email protected]
- GitHub: AntonioAPDL
- Website: antonio-aguirre.com