Skip to contents

An Extensible Framework for Mixtures of Quantile and Expectile Regressions

mixqr is an extensible framework for finite mixtures of quantile (and expectile) regressions in R. At its heart it finds hidden subgroups in your data and fits a separate quantile regression in each one: when a single regression line hides two (or more) distinct relationships (a high-return group and a low-return group, a fast-growing segment and a stagnant one), mixqr recovers the groups and their group-specific effects at once, without you having to label the groups in advance. Because it models a quantile rather than the mean, it is robust to skew and outliers and can describe effects in the tails as well as at the center.

Built on a single expectation–maximization (EM) substrate with a documented engine/extension contract, the package grows that core into a family of capabilities — expectile and M-quantile component families, component-specific penalized selection, and joint multi-quantile estimation with non-crossing — and the companion package mixqrgate adds location-varying gating.

The package fills a real gap in the R ecosystem. The only previous CRAN package for this model (qrmix) was archived in 2026 and used a heuristic, not the likelihood-and-EM estimator; ClusPred solves a different (covariate-driven latent-class) problem; flexmix and mixtools have no quantile / check-loss driver; and brms’s mixture(asym_laplace) cannot give the constrained, location-anchored components or the calibrated standard errors that inference requires. mixqr provides a clean, quantile-first interface, the first maintained implementation of the Wu & Yao (2016) kernel-density EM, and standard errors validated by simulation to reach near-nominal coverage.

📖 Full documentation and tutorial: https://kvenkita.github.io/mixqr/

Installation

# install.packages("remotes")
remotes::install_github("kvenkita/mixqr")

mixqr is pure R — no compiler or Stan toolchain required.

Quick start

library(mixqr)

# Two combustion regimes in the engine (ethanol) data
fit <- mixqr(equivalence ~ nox, data = engine, tau = 0.5, m = 2,
             variance = "stochEM")

summary(fit)                 # component coefficients with calibrated standard errors
plot(fit)                    # data + component lines, and the error densities
predict(fit, type = "class") # which regime each observation belongs to

# Choose the number of components
mixqr_select(equivalence ~ nox, data = engine, tau = 0.5, m = 1:4,
             criterion = "cv")

Key features

  • Two estimation engines. A fast parametric asymmetric-Laplace (ALD) mixture with a genuine likelihood and AIC/BIC (the default), and the semiparametric kernel-density EM of Wu & Yao (2016) with nonparametric component error densities (robust to multimodal / asymmetric errors).
  • Any quantile. Fit the median, a tail, or several quantiles to trace how the group-specific effects change across the outcome distribution.
  • Calibrated inference. Sparsity standard errors and a stochastic-EM multiple-imputation estimator (Wu & Yao Algorithm 3.1). A Monte-Carlo benchmark shows the stochastic-EM intervals reach ~95% coverage for the regression coefficients; sparsity intervals are flagged as classification-conditional.
  • Diagnostics built in. A cluster-separability measure, a responsibility-overlap diagnostic, identifiability and component-collapse warnings, and an explicit flag when the tau-quantile constraint cannot be met.
  • Familiar interface. A formula API and the usual summary(), coef(), confint(), vcov(), predict(), plot(), AIC()/BIC() methods.
  • Expectile & M-quantile families (family =). Smooth, crossing-free component losses (Newey & Powell 1987; Breckling & Chambers 1988) beside the quantile check loss.
  • Component-specific penalized selection (mixqr_pen()). SCAD / adaptive-LASSO selection in which each latent regime gets its own sparse support.
  • Non-crossing multi-quantile fits (mixqr_nc()). Joint estimation across a grid of quantiles with one shared classification and order-respecting curves.
  • Extensible. A documented engine contract (register_mixqr_engine()) hosts all of the above, and the companion mixqrgate adds location-varying gating.

Key functions

Function Purpose
mixqr() Fit a finite mixture of quantile regressions
mixqr_control(), mixqr_vcontrol() EM and variance-estimation settings
mixqr_select() Choose the number of components (AIC / BIC / CV)
mixqr(family = ) Quantile, expectile or M-quantile component losses
mixqr_pen(), selectedVars() Component-specific penalized variable selection
mixqr_nc() Joint multi-quantile fit: shared classification + non-crossing
summary(), coef(), confint() Component estimates, SEs and intervals
predict() Component quantiles, classification, posteriors
plot() Data + component lines and error densities
sim_mixqr2(), sim_mixqr3() Reproducible Wu & Yao simulation designs

Documentation

  • Tutorial — a comprehensive, accessible guide for applied researchers: the method, when to use it, fitting and interpreting models, beautiful visualizations of estimates and diagnostics, model selection, and reporting.
  • Get started — a short tour.
  • Extensions — expectile/M-quantile families, penalized selection, and non-crossing fits.
  • Validation & diagnostics — the simulation evidence behind the estimates and the standard errors.
  • Function reference.

Citation

If you use mixqr, please cite it:

Venkitasubramanian, K. (2026). mixqr: Extensible Finite Mixtures of Quantile and Expectile Regressions. R package version 0.2.0. https://github.com/kvenkita/mixqr

citation("mixqr")

Please also cite the underlying methodology — Wu & Yao (2016) for the mixture-of-quantile-regressions estimator, and Koenker & Bassett (1978) for quantile regression.

Author and license

Created and maintained by Kailas Venkitasubramanian, University of North Carolina at Charlotte. Released under the MIT License.

References

  • Wu, Q. & Yao, W. (2016). Mixtures of quantile regressions. Computational Statistics & Data Analysis, 93, 162–176.
  • Koenker, R. & Bassett, G. (1978). Regression quantiles. Econometrica, 46(1), 33–50.
  • Hall, P. & Presnell, B. (1999). Density estimation under constraints. Journal of Computational and Graphical Statistics, 8(2), 259–277.
  • Yu, K. & Moyeed, R. A. (2001). Bayesian quantile regression. Statistics & Probability Letters, 54(3), 437–447.
  • Alfò, M., Salvati, N. & Ranalli, M. G. (2017). Finite mixtures of quantiles and M-quantile regression models. Statistics and Computing, 27(2), 547–570.