Sieve quantile-function mixtures and distributional synthetic controls
qfmix approximates a target quantile function as a weighted mixture of quantile basis functions and estimates the weights by a sieve generalized method of L-moments — matching sample L-moments to the mixture’s L-moments, which reduces to a convex quadratic program. It implements the estimator and the numerical-bootstrap inference of Alvarez & Orestes (2024), and a distributional synthetic-control wrapper that delivers counterfactual quantile functions with pointwise confidence bands — a step toward the formal inference that placebo-based distributional synthetic controls lack (Gunsilius 2023). This v0.1 ships the estimator and variance-component bands; the bias-corrected and ball anti-concentration bands are planned.
This is a different object from a finite mixture of quantile regressions (see the mixqr family): here whole quantile functions are mixed with a free weight vector, estimated by moment matching rather than EM.
Installation
# install.packages("remotes")
remotes::install_github("kvenkita/qfmix")Quick start
library(qfmix)
# fit a quantile-function mixture to a sample
x <- qexp(runif(1000))
fit <- qfmix(x, basis = "legendre", p = 5)
predict(fit, c(0.1, 0.5, 0.9)) # mixture quantiles
# numerical-bootstrap band for the quantile function
bt <- qfmix_boot(fit, S = 500, target = "quantile")
plot(fit, band = bt)
# distributional synthetic control with confidence bands
fit_dsc <- dsc(panel, "unit", "year", "y", treated = "A", t0 = 2018)
plot(fit_dsc, period = 2019, which = "effect")
summary(fit_dsc)Key features
-
Sieve GMLM estimator. L-moment matching → convex QP over
unconstrained,nonneg,simplex, orridgeweights, with optional grid monotonicity and two-step optimal weighting. -
Pluggable quantile bases.
polynomial,legendre,pareto,gev,empirical, or your own viaqfmix_basis(). GEV/Pareto bases support tail extrapolation. - Numerical-bootstrap inference. Confidence bands for the weights and the mixture quantile function, simulated from the strong-approximation limit — not a resampling bootstrap.
-
Distributional synthetic controls with inference.
dsc()returns counterfactual quantiles and distributional treatment effects with pointwise bands;summary()reports effects by percentile. -
Density inversion.
density()turns the fitted quantile mixture into a density (Empirical-Bayes f-modelling).