Fits a finite mixture of tau-quantile regressions whose mixing probabilities follow a multinomial-logit gate on concomitant covariates, optionally indexed by the quantile level. The gate turns the location-varying mixing of Furno (2025) into a likelihood/EM object with standard errors.
Usage
mixqrgate(
formula,
data,
gating = ~1,
G = 2L,
tau = 0.5,
vary_gating = c("none", "discrete"),
method = c("ald", "kde"),
variance = c("sandwich", "louis", "stochEM"),
gate_B = 200L,
control = mixqrgate_control()
)Arguments
- formula
Component model,
y ~ x1 + x2(intercept implied).- data
A data frame.
- gating
One-sided concomitant gate formula in the gating covariates;
~1(default) reproduces a constant gate (and the plainmixqrfit).- G
Number of components. Default
2.- tau
Quantile level(s) in (0, 1). A vector triggers a location-varying (per-tau) gate.
- vary_gating
"none"(gate depends on covariates, not tau) or"discrete"(a separate gate per tau-grid point; Furno mode).- method
"ald"(parametric asymmetric-Laplace, genuine likelihood) or"kde"(Wu & Yao nonparametric error densities).- variance
Gate standard errors.
"sandwich"(default) is the observed-information sandwich conditional on the fitted class memberships, so it under-covers when components overlap."louis"applies Louis's (1982) identity to the gate block – an analytic, classification-aware covariance (complete information minus the missing information from the latent labels), the recommended choice for inference."stochEM"is a multiple-imputation alternative (slower; a useful cross-check).- gate_B
Number of imputations for
variance = "stochEM". Default200.- control
A
mixqrgate_control()list.
Examples
set.seed(1)
d <- sim_gate2(n = 300)
fit <- mixqrgate(y ~ x, data = d, gating = ~ z, G = 2, tau = 0.5)
fit
#> Gated mixture of quantile regressions (mixqrgate)
#> components G = 2 method = ald n = 300
#> tau grid: 0.5 gating: ~z
#> vary_gating = none
#>
#> Class-average gate probabilities (rows = components, cols = tau):
#> tau=0.5
#> comp1 0.499
#> comp2 0.501
#>
#> Component coefficients at tau = 0.5 :
#> comp1 comp2
#> (Intercept) 1.8292 -1.9932
#> x -3.1785 2.9978