# 混合回归（统计学）

混合回归是一种统计建模方法，它拟合若干回归模型的加权组合，从而能够从数据中识别并估计出具有不同预测变量—结果关系的子群体。该方法假定观测值来自少数几个潜在组别——称为成分或机制——并在每个组别中分别估计一个回归，在没有任何预先给定标签的情况下同时发现分组结构与组别特定效应。<sup>[1](https://kvenkita.github.io/mixqr/articles/mixqr-tutorial.html)</sup> 这与在已知分组上分别跑回归不同：组别归属不可观测，必须与系数一同推断。

| 关键事实 | 详情 |
|---|---|
| 模型 | 每个观测以概率 \( \pi_{j} \) 服从回归成分 \( j \)；各成分在系数和误差方差上不同<sup>[2](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)</sup> |
| 估计 | EM算法：E步计算后验责任度，M步进行加权最小二乘与加权多项logit<sup>[2](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)</sup> |
| 起源 | 切换回归（匡特，1972）；矩生成函数估计量（匡特与拉姆齐，1978）；基于EM的两成分混合拟合（德沃，1989）<sup>[3](https://doi.org/10.1080/01621459.1972.10482378)</sup> |
| 机器学习变体 | 专家混合（雅各布斯及同事，1991），其门控权重依赖于协变量<sup>[4](https://doi.org/10.1162/neco.1991.3.1.79)</sup> |
| 模型选择 | AIC、BIC与ICL；似然比检验统计量对混合模型不满足其正则条件<sup>[5](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup> |
| 主要失效模式 | 成分方差趋近于零导致似然无界、局部极大值、标签切换<sup>[6](https://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf)</sup> |
| 软件 | R中的flexmix、mixtools与mclust<sup>[7](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup> |

## 工作原理

其生成原理是潜在类别。混合模型假定过程为 \( p(z, x) = p(z) \cdot p(x \mid z) \)，其中潜在变量 \( z \) 是混合成分，取值于 \( \{1, \dots, K \} \)，服从多项先验 \( p(z) \)。<sup>[8](https://cs.toronto.edu/%7Ergrosse/csc321/mixture_models.pdf)</sup> 在线性回归的高斯混合中，观测 \( i \) 以概率 \( \pi_{j} \) 服从 \( y_{i} = x_{i}^{T} \cdot \beta_{j} + \varepsilon_{ij} \)，其中 \( \varepsilon_{ij} \sim N(0, \sigma_{j}^{2}) \)；切换回归则写成同一形式：\( y \mid x \sim p_{1} N(x \cdot \beta_{1}, \sigma_{1}^{2}) + \cdots + p_{k} N(x \cdot \beta_{k}, \sigma_{k}^{2}) \)。<sup>[2](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)</sup><sup> • </sup><sup>[9](https://www.ceremade.dauphine.fr/~xian/jcgsrobert.pdf)</sup>

对数似然是各观测的成分密度加权和之对数的总和，即 \( \ell(\Psi) = \sum_{i} \log \{ \sum_{k} \pi_{k} f_{k}(x_{i}; \theta_{k}) \} \)，由于潜在类别归属不可观测，直接最大化它很困难；因此混合模型通常作为不完全数据问题来重新拟合。<sup>[5](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)</sup>

## 实现方法

**EM算法。** 在成分数固定的情况下，最大似然拟合把不可观测的成分归属视为缺失数据。<sup>[10](https://statmath.wu.ac.at/AASC/ci/papers/Gruen+Leisch-2006a.pdf)</sup> E步计算后验责任度 \( w_{ij} = \pi_{j} \varphi_{j}(y_{i} \mid x_{i}) / \sum_{j} \pi_{j} \varphi_{j}(y_{i} \mid x_{i}) \)，即观测 \( i \) 属于成分 \( j \) 的后验概率。<sup>[2](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)</sup> M步分两部分最大化期望完全数据对数似然：\( Q_{1} \) 通过成分回归模型的加权最大似然，给出加权最小二乘更新 \( \hat{\beta}_{j} = (X^{T} \cdot W_{j} \cdot X)^{-1} X^{T} \cdot W_{j} \cdot Y \) 与 \( \hat{\sigma}_{j}^{2} = \sum_{i} w_{ij} (y_{i} - x_{i}^{T} \hat{\beta}_{j})^{2} / \sum_{i} w_{ij} \)；\( Q_{2} \) 通过权重所用多项logit模型的加权最大似然，混合比例为 \( \hat{\pi}_{j} = \sum_{i} w_{ij} / n \)。<sup>[2](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)</sup><sup> • </sup><sup>[11](https://cran.r-project.org/web/packages/flexmix/vignettes/mixture-regressions.Rnw)</sup>

**实际工作流程。** 由于EM只能保证找到局部极大值，建议从不同初值出发反复运行。<sup>[10](https://statmath.wu.ac.at/AASC/ci/papers/Gruen+Leisch-2006a.pdf)</sup> 选择 \( K \) 的更佳做法是拟合成分数递增的一系列模型，并用AIC或BIC加以比较。<sup>[6](https://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf)</sup>

## 起源

切换回归模型由理查德·E·匡特在《估计切换回归的一种新方法》（《美国统计协会杂志》，1972）中提出，其中“自然”以未知概率 \( \lambda \) 与 \( 1 - \lambda \) 在两个机制之间选择，使得 \( y_{i} \) 的密度为 \( \lambda f_{1i} + (1 - \lambda) f_{2i} \)，文中还给出了针对“无切换”原假设的似然比检验。<sup>[3](https://doi.org/10.1080/01621459.1972.10482378)</sup><sup> • </sup><sup>[12](https://www.nber.org/system/files/chapters/c9938/c9938.pdf)</sup> 匡特与詹姆斯·B·拉姆齐于1978年引入了针对正态分布混合与切换回归的矩生成函数估计量，其动机是有限混合似然的无界性，并将其应用于一个工资议价模型。<sup>[13](https://doi.org/10.1080/01621459.1978.10480085)</sup><sup> • </sup><sup>[13](https://doi.org/10.1080/01621459.1978.10480085)</sup> 相关的早期工作还包括尼古拉斯·M·基弗对具有离散参数变化的切换回归模型的有效估计（《计量经济学》，1978）。<sup>[14](https://doi.org/10.2307/1913910)</sup> 后来成为标准估计量的EM算法由A. P. 登普斯特、N. M. 莱尔德与D. B. 鲁宾于1977年形式化。<sup>[15](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)</sup> 理查德·D·德沃在《线性回归的混合》（《计算统计与数据分析》，第8卷第3期，第227–245页，1989）中针对两成分情形提出了基于EM的线性回归混合方法。<sup>[16](https://doi.org/10.1016/0167-9473%2889%2990043-1)</sup><sup> • </sup><sup>[17](https://ideas.repec.org/a/eee/csdana/v8y1989i3p227-245.html)</sup> 在机器学习文献中，罗伯特·A·雅各布斯及同事在《局部专家的自适应混合》（《神经计算》，1991）中提出了专家混合，迈克尔·I·乔丹与罗伯特·A·雅各布斯则用EM算法发展了分层专家混合（《神经计算》，1994）。<sup>[4](https://doi.org/10.1162/neco.1991.3.1.79)</sup><sup> • </sup><sup>[18](https://doi.org/10.1162/neco.1994.6.2.181)</sup> 伴随变量潜在类别模型——其中混合权重依赖于协变量——由C. 米切尔·戴顿与乔治·B·麦克雷迪提出（《美国统计协会杂志》，1988）。<sup>[19](https://doi.org/10.1080/01621459.1988.10478584)</sup> 米歇尔·韦德尔与韦恩·S·德萨博提出了广义线性模型的混合似然方法（《分类杂志》，1995）。<sup>[20](https://doi.org/10.1007/bf01202266)</sup>

## 变体

**专家混合与HME。** 在专家混合模型中，成分密度 \( f_{g}(y_{i} \mid \theta_{g}(x_{i})) \) 是专家，对输入空间的不同部分建模，成分权重 \( \eta_{g}(x_{i}) \) 是门控网络；原始模型是一种树状分治架构，后来扩展为分层专家混合，其中混合系数与成分均为广义线性模型。<sup>[21](https://ar5iv.labs.arxiv.org/html/1806.08200)</sup><sup> • </sup><sup>[22](https://www.ee.hacettepe.edu.tr/~eyuksel/Publications/2012_TwentyYearsofMixtureofExperts.pdf)</sup>

**潜在类别与GLIMMIX模型。** 回归模型的离散混合——亦称潜在类别回归或按簇回归——带有伴随变量多项logit权重以及变效应或固定效应，已在R包flexmix中实现；广义线性模型的混合在营销文献中被称为GLIMMIX模型。<sup>[6](https://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf)</sup><sup> • </sup><sup>[11](https://cran.r-project.org/web/packages/flexmix/vignettes/mixture-regressions.Rnw)</sup><sup> • </sup><sup>[20](https://doi.org/10.1007/bf01202266)</sup>

**其他变体。** 分位数回归的混合将机制 \( j \) 中的条件第 \( \tau \) 分位数建模为 \( Q_{\tau}(Y \mid x, Z = j) = x' \cdot \beta_{j} \)，并用EM估计。<sup>[1](https://kvenkita.github.io/mixqr/articles/mixqr-tutorial.html)</sup> 混合密度网络由克里斯·毕晓普于1994年提出，它用经随机梯度下降训练的神经网络学习协变量到权重的映射关系。<sup>[23](http://arxiv.org/pdf/2211.09875v1)</sup>

## 应用

回归混合模型最初应用于住房建设中的异质性，后来用于工资预测、展会表现与消费者细分。<sup>[24](https://pmc.ncbi.nlm.nih.gov/articles/PMC8865476/)</sup> 在经济学中，切换回归框架被用于重新估计费尔与贾菲的住房市场模型，并扩展到两个以上机制、马尔可夫转移模型与联立方程系统。<sup>[12](https://www.nber.org/system/files/chapters/c9938/c9938.pdf)</sup> 在营销中，广义线性模型的混合用于市场细分，例如确定价格弹性相近的消费者群体以服务于定价策略。<sup>[25](https://epub.ub.uni-muenchen.de/2087/1/tr013.pdf)</sup>

## 局限与替代方案

**失效模式。** 在成分方差不受约束时，当某个成分方差趋于零，高斯似然无界，会产生虚假的大的局部极大值；EM收敛缓慢且只收敛到局部极大值，flexmix会移除先验低于阈值（默认0.05）的成分，以避免成分消失带来的不稳定性。<sup>[6](https://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf)</sup><sup> • </sup><sup>[7](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)</sup>

**比较。** 回归混合模型适合探索性地寻找少数几个共享典型预测变量—结果关系的类别，而回归交互项适合对特定效应做直接的假设检验；随着类别数增加，这种比较会变得更复杂。<sup>[26](https://journals.sagepub.com/doi/10.1177/0013164414554931)</sup> 与基于模型的树相比，带伴随变量的混合通过多项logit权重假定子群体之间是平滑、单调的过渡，而树的分裂代表突变的、可能非单调的转变；协变量对混合模型是可选的，对树则是必需的；当协变量关联很强时，树能检测到更小的参数差异，而混合模型更擅长检测与协变量仅松散关联的子群体。<sup>[27](https://www.frick.ws/papers/Frick+Strobl+Zeileis-2014.pdf)</sup>

**理论。** 回归模型的混合引入了超出分布混合之外的可识别性问题。<sup>[25](https://epub.ub.uni-muenchen.de/2087/1/tr013.pdf)</sup>

## References

1. [A Tutorial on Mixtures of Quantile Regressions • mixqr](https://kvenkita.github.io/mixqr/articles/mixqr-tutorial.html)
2. [Fitting mixtures of linear regressions (Faria & Soromenho, Journal of Statistical Computation and Simulation, 80(2), 2010, 201–225)](https://repositorio.ul.pt/bitstream/10451/4682/1/Fitting%20mixtures%20of%20linear%20regressions.pdf)
3. [Richard E. Quandt (1972). A New Approach to Estimating Switching Regressions. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1972.10482378)
4. [Robert A. Jacobs and colleagues (1991). Adaptive Mixtures of Local Experts. Neural Computation.](https://doi.org/10.1162/neco.1991.3.1.79)
5. [Finite Mixture Models – Model-Based Clustering... Using mclust in R (Scrucca et al., book chapter)](https://mclust-org.github.io/mclust-book/chapters/02_mixture.html)
6. [FlexMix: A General Framework for Finite Mixture Models and Latent Class Regression in R (Leisch, Journal of Statistical Software, 2004)](https://cran.r-project.org/web/packages/flexmix/vignettes/flexmix-intro.pdf)
7. [Finite Mixture Models (McLachlan & Lee, Annual Review of Statistics and Its Application, 2019)](https://gwern.net/doc/statistics/probability/2019-mclachlan.pdf)
8. [Lecture 16: Mixture models (CSC321, University of Toronto)](https://cs.toronto.edu/%7Ergrosse/csc321/mixture_models.pdf)
9. [Estimating Mixtures of Regressions (Hurn, Justel & Robert, JCGS)](https://www.ceremade.dauphine.fr/~xian/jcgsrobert.pdf)
10. [Fitting Finite Mixtures of Linear Regression Models with Varying and Fixed Effects (Grün & Leisch, 2006)](https://statmath.wu.ac.at/AASC/ci/papers/Gruen+Leisch-2006a.pdf)
11. [Mixture regressions vignette (flexmix R package, Grün & Leisch)](https://cran.r-project.org/web/packages/flexmix/vignettes/mixture-regressions.Rnw)
12. [The Estimation Of Structural Shifts By Switching Regressions (NBER chapter)](https://www.nber.org/system/files/chapters/c9938/c9938.pdf)
13. [Richard E. Quandt, James B. Ramsey (1978). Estimating Mixtures of Normal Distributions and Switching Regressions. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1978.10480085)
14. [Nicholas M. Kiefer (1978). Discrete Parameter Variation: Efficient Estimation of a Switching Regression Model. Econometrica.](https://doi.org/10.2307/1913910)
15. [A. P. Dempster, N. M. Laird, D. B. Rubin (1977). Maximum Likelihood from Incomplete Data Via the EM Algorithm. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1111/j.2517-6161.1977.tb01600.x)
16. [Mixtures of linear regressions (Computational Statistics & Data Analysis, 1989)](https://doi.org/10.1016/0167-9473%2889%2990043-1)
17. [Mixtures of linear regressions (De Veaux, Computational Statistics & Data Analysis 1989), bibliographic record](https://ideas.repec.org/a/eee/csdana/v8y1989i3p227-245.html)
18. [Michael I. Jordan, Robert A. Jacobs (1994). Hierarchical Mixtures of Experts and the EM Algorithm. Neural Computation.](https://doi.org/10.1162/neco.1994.6.2.181)
19. [C. Mitchell Dayton, George B. Macready (1988). Concomitant-Variable Latent-Class Models. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1988.10478584)
20. [Michel Wedel, Wayne S. DeSarbo (1995). A mixture likelihood approach for generalized linear models. Journal of Classification.](https://doi.org/10.1007/bf01202266)
21. [Mixtures of Experts Models (Handbook of Mixture Analysis chapter)](https://ar5iv.labs.arxiv.org/html/1806.08200)
22. [Twenty Years of Mixture of Experts](https://www.ee.hacettepe.edu.tr/~eyuksel/Publications/2012_TwentyYearsofMixtureofExperts.pdf)
23. [Neural mixture of experts distributional regression (NMDR)](http://arxiv.org/pdf/2211.09875v1)
24. [Effects of Mixing Weights and Predictor Distributions on Regression Mixture Models (PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC8865476/)
25. [Finite Mixtures of Generalized Linear Regression Models (Grün & Leisch, technical report)](https://epub.ub.uni-muenchen.de/2087/1/tr013.pdf)
26. [Evaluating Differential Effects Using Regression Interactions and Regression Mixture Models (Educational and Psychological Measurement)](https://journals.sagepub.com/doi/10.1177/0013164414554931)
27. [To Split or to Mix? Tree vs. Mixture (Frick, Strobl & Zeileis)](https://www.frick.ws/papers/Frick+Strobl+Zeileis-2014.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026; Oct 21, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Regression analysis

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/mixture-regression-statistics

English original: https://www.edgepedia.org/mixture-regression-statistics
