MyNixOS website logo
Description

Extensible Finite Mixtures of Quantile and Expectile Regressions.

An extensible expectation-maximization (EM) framework for finite mixtures of quantile regressions (clusterwise / mixture-of-experts quantile regression). A single EM substrate with an engine/extension contract carries a family of capabilities: the core free-weight mixture of Wu and Yao (2016) <doi:10.1016/j.csda.2014.04.014> -- a fast asymmetric-Laplace path and the nonparametric kernel-density EM with components constrained to have their tau-quantile equal to zero (Hall and Presnell 1999 device); expectile and M-quantile component-loss families (Newey and Powell 1987; Breckling and Chambers 1988); component-specific penalized variable selection (SCAD / adaptive-LASSO, the quantile analogue of Khalili and Chen 2007); and joint multi-quantile estimation with a shared latent classification and non-crossing component curves. Provides classification-aware standard errors (sparsity and stochastic-EM multiple imputation), multi-start estimation, component-count selection, and prediction. The companion package 'mixqrgate' adds location-varying gating.

mixqr

Lifecycle: experimental License: MIT

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

FunctionPurpose
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.
Metadata

Version

0.2.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows