# 多元自适应回归样条

多元自适应回归样条（Multivariate adaptive regression splines，MARS）是一种非参数回归方法，它将响应变量表示为乘积样条基函数展开式，其中基函数的数目、乘积阶数以及节点位置均由数据自动确定。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup> 与递归划分不同，MARS 产生的是具有连续导数的连续模型，并且能够分别识别少数变量之间的可加贡献与交互作用。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup> 其作者针对的是样本量适中（50 ≤ N ≤ 1000）、维度中等到较高（3 ≤ n ≤ 20）的情形。<sup>[2](https://www.slac.stanford.edu/cgi-bin/getdoc/slac-pub-4960.pdf)</sup>

| 属性 | 详情 |
| --- | --- |
| 模型形式 | 乘积样条基函数展开式；基函数数目、阶数与节点由数据确定 <sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup> |
| 原始论文 | Jerome H. Friedman，《统计年鉴》19(1):1–67，1991年3月 <sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup> |
| 基函数 | 反射对 \( (x_j - t)_{+} \) 与 \( (t - x_j)_{+} \)；对于 N 个观测和 p 个预测变量，候选集包含 \( 2 \cdot N \cdot p \) 个函数 <sup>[3](http://www.ideal.ece.utexas.edu/courses/ee380l_ese/2013/mars.pdf)</sup> |
| 模型选择 | \( \mathrm{GCV} = \mathrm{ASR}/(1 - C(M)/N)^{2} \)，其中代价 \( C(M) \) 介于 3M 与 5M 之间 <sup>[4](http://www.stat.yale.edu/~arb4/publications_files/DiscussionMultivariateAdaptiveRegressionSplines.pdf)</sup> |
| 关键调节参数 | degree（默认 1）、每个节点的 GCV 惩罚（默认 2 或 3；研究表明约为 2 到 4）、fast.k（默认 20） <sup>[5](https://cran.ms.unimelb.edu.au/web/packages/earth/earth.pdf)</sup> |
| 软件 | earth（R）、mda::mars（R）、MARSplines（TIBCO）、py-earth 以及 mars（Python） <sup>[5](https://cran.ms.unimelb.edu.au/web/packages/earth/earth.pdf)</sup><sup> • </sup><sup>[6](https://rdrr.io/cran/mda/man/mars.html)</sup><sup> • </sup><sup>[7](https://machinelearningmastery.com/multivariate-adaptive-regression-splines-mars-in-python/)</sup><sup> • </sup><sup>[8](https://github.com/edithatogo/pymars)</sup><sup> • </sup><sup>[9](https://docs.tibco.com/data-science/GUID-ED6E1533-EAE7-4C5B-ACFD-DCC20D894C44.html)</sup> |
| 名称 | “MARS”为注册商标，并独家授权给 Salford Systems，这也是 R 包命名为 earth 的原因 <sup>[10](https://bradleyboehmke.github.io/HOML/mars.html)</sup> |

## 工作原理

MARS 从铰链函数——即反射对 \( (x_j - t)_{+} \) 与 \( (t - x_j)_{+} \)——出发构建拟合。每个预测变量的每个观测值都被作为候选节点加以评估，因此在所有输入值互不相同的情况下，候选集包含 \( 2 \cdot N \cdot p \) 个反射对。<sup>[3](http://www.ideal.ece.utexas.edu/courses/ee380l_ese/2013/mars.pdf)</sup> MARS 对递归划分进行推广的核心思想，是将该过程中隐含的阶跃函数替换为截断幂样条基函数；使用 q = 1 的截断幂基可保持前向阶段的近似为分段线性，并避免高阶回归样条在高维情形下出现的严重边界（端效应）方差问题。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup>

交互作用以乘积形式进入模型：每一步的候选项具有形式 \( B_m(\mathbf{x})[\pm(x_j - t)]_{+} \)，其中 \( B_m \) 是已有的基函数，且预测变量 \( x_j \) 被限制为尚未成为 \( B_m \) 的因子。<sup>[4](http://www.stat.yale.edu/~arb4/publications_files/DiscussionMultivariateAdaptiveRegressionSplines.pdf)</sup> 将外层循环限制为单个变量即迫使模型成为可加模型。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup> 最终模型是所选 q = 1 铰链基函数乘积之和；无交互作用时其各段为线性，而交互项可产生更高阶的片段。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup>

## 实现方法

前向过程从常数函数开始，反复将已有基函数与线性样条函数的反射对之乘积加入模型，每一步选择使训练误差下降最大的项。<sup>[11](https://www.jmlr.org/papers/volume24/22-1422/22-1422.pdf)</sup> 每个前向步骤耗时 O(N)，因为相邻节点之间的回归差异只需加减一项即可计算。<sup>[3](http://www.ideal.ece.utexas.edu/courses/ee380l_ese/2013/mars.pdf)</sup> 随后后向过程删除那些移除后残差平方和增加最小的项。<sup>[11](https://www.jmlr.org/papers/volume24/22-1422/22-1422.pdf)</sup>

模型选择使用广义交叉验证（generalized cross-validation，GCV），这是一种计算捷径，用于近似参数线性模型的留一交叉验证误差。<sup>[10](https://bradleyboehmke.github.io/HOML/mars.html)</sup> 在自适应样条文献中所印出的形式为，

\[ \mathrm{GCV}(M) = \frac{1}{n}\,\frac{\sum_{i=1}^{n}(y_i - \hat{f}_M(\mathbf{x}_i))^{2}}{(1 - P(M)/n)^{2}}, \qquad P(M) = r + d \cdot N, \]

其中 r 为线性无关基函数的数目，N 为节点数，可加模型取 d = 2，交互模型取 d = 3。<sup>[12](https://link.springer.com/article/10.1007/s10898-013-0107-5)</sup> 由于节点依赖于响应变量，Friedman 在 \( \mathrm{GCV} = \mathrm{ASR}/(1 - C(M)/N)^{2} \) 中以介于 3M 与 5M 之间的代价 \( C(M) \) 替代参数计数 M，以在大量多半是虚假的候选项中进行选择时防止过拟合。<sup>[4](http://www.stat.yale.edu/~arb4/publications_files/DiscussionMultivariateAdaptiveRegressionSplines.pdf)</sup> 模拟研究将最佳代价参数 d 定在 2 ≤ d ≤ 4 的范围内，且在该范围内精度对取值相当不敏感。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup>

若干软件包实现了该方法。R 包 earth 实现了 Friedman 的 MARS 与 Fast MARS 论文中的技术；其 degree 参数即最大交互阶数，默认值 1 表示可加模型。<sup>[5](https://cran.ms.unimelb.edu.au/web/packages/earth/earth.pdf)</sup> mda 包的 mars 函数未使用 Friedman 的代码，系从头编写，结果相似但不完全相同，且可处理多个响应变量。<sup>[6](https://rdrr.io/cran/mda/man/mars.html)</sup> scikit-learn 中没有 MARS；py-earth 库提供了与 scikit-learn 兼容的实现。TIBCO 的 MARSplines 可处理分类与连续预测变量及响应变量，并支持多个因变量。<sup>[9](https://docs.tibco.com/data-science/GUID-ED6E1533-EAE7-4C5B-ACFD-DCC20D894C44.html)</sup>

## 起源

MARS 由 Jerome H. Friedman 在《多元自适应回归样条》（《统计年鉴》19(1):1–67，1991）一文中提出。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup><sup> • </sup><sup>[2](https://www.slac.stanford.edu/cgi-bin/getdoc/slac-pub-4960.pdf)</sup> Friedman 将其定位为递归划分回归的推广——并归功于前身方法 AID 与 CART——或定位为 Friedman 与 Silverman（1989）可加建模方法的推广。<sup>[2](https://www.slac.stanford.edu/cgi-bin/getdoc/slac-pub-4960.pdf)</sup> 该早期工作引入了节点位置由数据确定、用于分段线性拟合的逐步节点放置程序，MARS 对此加以扩展，并使用 Craven 与 Wahba（1979）的广义交叉验证度量来估计未来预测误差。<sup>[13](https://doi.org/10.1080/00401706.1989.10488470)</sup> 一篇教程总结了该算法及其针对二值响应、分类预测变量、嵌套变量和缺失值的扩展，并附有一个临床数据示例。<sup>[14](https://pubmed.ncbi.nlm.nih.gov/8548103/)</sup>

## 变体

**加速与节点搜索的替代方案。** Fast MARS 策略限制前向过程中每一步所考虑的父项数目；在 R 的 earth 包中，fast.k 参数（默认 20）实现了这一点，取值越低速度越快，取值越高或禁用该参数则构建更好的模型。<sup>[5](https://cran.ms.unimelb.edu.au/web/packages/earth/earth.pdf)</sup> 节点选择也可限制为由类似自组织映射的映射方法所选出的子集，因为从所有互异数据点中选择节点计算代价高昂且会产生较高的局部方差。<sup>[12](https://link.springer.com/article/10.1007/s10898-013-0107-5)</sup> 针对 MARS 的爬山节点优化方法由 Xinglong Ju、Victoria C.P. Chen、Jay M. Rosenberger 和 Feng Liu 于 2021 年提出。<sup>[15](https://doi.org/10.1016/j.eswa.2021.114565)</sup> 讨论者的 MAPS（multivariate adaptive polynomial synthesis，多元自适应多项式合成）方法在所研究的数据集上与 MARS 在统计精度上没有实质差异——前提是谨慎处理模型选择准则——并且由于候选基集更小，计算上应当更快。<sup>[4](http://www.stat.yale.edu/~arb4/publications_files/DiscussionMultivariateAdaptiveRegressionSplines.pdf)</sup>

**多响应与分类。** POLYMARS 将 MARS 扩展至允许多个响应变量，主要针对多项响应数据的多类别分类而开发。<sup>[16](https://www.sciencedirect.com/science/article/abs/pii/S0167947302001238)</sup> 贝叶斯 MARS（Bayesian MARS）由 Denison、Mallick 和 Smith（《统计与计算》，1998）提出，使用带有 MARS 基函数的潜高斯模型以及可逆跳马尔可夫链蒙特卡洛方法（后者归功于 Green，1995），对包括基函数数目在内的分类模型进行推断。<sup>[17](https://doi.org/10.1023/a:1008824606259)</sup><sup> • </sup><sup>[18](https://doi.org/10.1093/biomet/82.4.711)</sup> GBMARS 由 Rumsey、Francom 和 Shen（2023）提出，推广了贝叶斯框架，使条件后验预测分布属于广义双曲类，从而能够使用 t 分布进行稳健回归，并使用非对称拉普拉斯似然进行分位数回归。<sup>[19](https://doi.org/10.48550/arxiv.2306.01911)</sup>

**正则化与混合形式。** CMARS 由 Gerhard-Wilhelm Weber、İnci Batmaz、Gülser Köksal、Pakize Taylan 和 Fatma Yerlikaya-Özkurt（2011）提出，以惩罚化 Tikhonov 正则化的形式通过连续优化支持 MARS。<sup>[20](https://doi.org/10.1080/17415977.2011.624770)</sup> RCMARS 由 Ayşe Özmen、Gerhard Wilhelm Weber、İnci Batmaz 和 Erik Kropat（2011）提出，在多面体不确定性集合下使 CMARS 稳健化。<sup>[21](https://doi.org/10.1016/j.cnsns.2011.04.001)</sup> SMARS 与 SCMARS 由 Elcin Kartal Koc、Cem Iyigun、İnci Batmaz 和 Gerhard-Wilhelm Weber（2014）提出，将映射方法的前向步骤与 CMARS 相结合，在性能相当的情况下时间效率最高，尤其适用于大型数据集。<sup>[22](https://doi.org/10.1007/s10898-014-0211-1)</sup> drMARS 纳入协变量的充分降维线性组合并建立了一致性；例如，\( (x_1 + x_2 + x_3 + x_4)^{3} \) 在传统 MARS 下具有三阶交互作用，但若线性组合被正确识别，在 drMARS 下仅为一阶。<sup>[11](https://www.jmlr.org/papers/volume24/22-1422/22-1422.pdf)</sup> fairMARS 将公平性度量整合进节点优化算法，为公平的节点放置提供了理论与经验证据。<sup>[23](https://doi.org/10.48550/arxiv.2402.15561)</sup>

## 应用

有文献记载的应用涵盖化学计量学校准——1992 年的教程介绍了用于非线性多元校准的 MARS<sup>[24](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.1180060405)</sup>——以及临床数据，后者见于 1995 年的教程。<sup>[14](https://pubmed.ncbi.nlm.nih.gov/8548103/)</sup> 在生态学中，对新西兰 15 种淡水鱼类分布建模显示，GAM 与 MARS 的表现差异甚小；BRUTO/GAM 模型平均比无交互作用的 MARS 模型多解释约 7% 的偏差，而带交互作用的 MARS 模型解释的偏差量最大。<sup>[25](https://www.sciencedirect.com/science/article/abs/pii/S0304380006002572)</sup> 同一研究指出，MARS 的分析速度异常之快，且其简单的基于规则的基函数便于在 GIS 中进行预测。<sup>[25](https://www.sciencedirect.com/science/article/abs/pii/S0304380006002572)</sup> 在时间序列中，将 POLYMARS 应用于滞后多元序列可得到 VASTAR 模型，该模型在日内电力负荷数据上比竞争的向量非线性时间序列模型拟合更好；MARS 此前已被用于日海表温度和汇率。<sup>[16](https://www.sciencedirect.com/science/article/abs/pii/S0167947302001238)</sup> 在金融领域，SMARS 与 SCMARS 被应用于预测土耳其某银行提供的利率。<sup>[22](https://doi.org/10.1007/s10898-014-0211-1)</sup>

## 局限与替代方法

一项大型模拟以平均积分平方误差比较了十种回归技术（线性回归、逐步线性回归、可加模型、投影寻踪回归、递归划分、MARS、ACE、AVAS、LOESS 和神经网络），发现 MARS 在维度较低（p = 2）时表现良好，随维度增大而退化，而递归划分在高维（p = 12）时表现良好。<sup>[26](https://www.cs.cmu.edu/~bobski/pubs/tr99102.pdf)</sup> 早先一项在两个函数上比较 MARS 与神经网络的研究发现，MARS 更快，且就 MISE 而言更准确。<sup>[26](https://www.cs.cmu.edu/~bobski/pubs/tr99102.pdf)</sup> 在一项员工离职分类任务中，一个经调优、无交互作用且含 12 项的 MARS 模型在准确率上并不优于逻辑回归和正则化回归。<sup>[10](https://bradleyboehmke.github.io/HOML/mars.html)</sup>

随着 n 与 p 同时增大，MARS 的训练通常较慢，因为算法要扫描每个预测变量的每个值以寻找潜在切点。<sup>[10](https://bradleyboehmke.github.io/HOML/mars.html)</sup> 当预测变量几乎完全相关时，算法实质上会选择它遇到的第一个变量，而相关特征很可能不会被纳入，从而使解释变得困难。<sup>[10](https://bradleyboehmke.github.io/HOML/mars.html)</sup> q = 1 的基避免了高阶样条的边界端效应方差，Friedman 认为，强加一阶导数以上的连续性所得甚少而所失甚多，在高维情形下尤其如此；相比之下，递归划分的分段常数模型在子区域边界处急剧不连续，严重限制了近似精度。<sup>[1](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)</sup>

## References

1. [Multivariate Adaptive Regression Splines (Friedman, The Annals of Statistics 19(1):1–67, 1991, publisher page; full-text copy at stat.yale.edu merged)](https://projecteuclid.org/journals/annals-of-statistics/volume-19/issue-1/Multivariate-Adaptive-Regression-Splines/10.1214/aos/1176347963.full)
2. [SLAC PUB-4960 Rev / Stanford Statistics Tech Report 102 Rev (August 1990), preprint of the MARS paper](https://www.slac.stanford.edu/cgi-bin/getdoc/slac-pub-4960.pdf)
3. [MARS overview slides (Bansal & Salling, UT ECE, 2013)](http://www.ideal.ece.utexas.edu/courses/ee380l_ese/2013/mars.pdf)
4. [Discussion: Multivariate Adaptive Regression Splines (published discussion of Friedman 1991; MAPS comparison)](http://www.stat.yale.edu/~arb4/publications_files/DiscussionMultivariateAdaptiveRegressionSplines.pdf)
5. [earth: Multivariate Adaptive Regression Splines, R package documentation](https://cran.ms.unimelb.edu.au/web/packages/earth/earth.pdf)
6. [mars: Multivariate Adaptive Regression Splines in mda (R documentation)](https://rdrr.io/cran/mda/man/mars.html)
7. [Multivariate Adaptive Regression Splines (MARS) in Python (MachineLearningMastery tutorial)](https://machinelearningmastery.com/multivariate-adaptive-regression-splines-mars-in-python/)
8. [mars: A Pure Python Implementation of Multivariate Adaptive Regression Splines (formerly pymars)](https://github.com/edithatogo/pymars)
9. [Multivariate Adaptive Regression Splines (MARSplines) Overview (TIBCO/STATISTICA documentation)](https://docs.tibco.com/data-science/GUID-ED6E1533-EAE7-4C5B-ACFD-DCC20D894C44.html)
10. [Chapter 7 Multivariate Adaptive Regression Splines | Hands-On Machine Learning with R (Boehmke & Greenwell)](https://bradleyboehmke.github.io/HOML/mars.html)
11. [Dimension Reduction and MARS (drMARS, JMLR 24, 2023)](https://www.jmlr.org/papers/volume24/22-1422/22-1422.pdf)
12. [Restructuring forward step of MARS algorithm using a new knot selection procedure based on a mapping approach (Journal of Global Optimization)](https://link.springer.com/article/10.1007/s10898-013-0107-5)
13. [Jerome H. Friedman, Bernard W. Silverman (1989). Flexible Parsimonious Smoothing and Additive Modeling. Technometrics.](https://doi.org/10.1080/00401706.1989.10488470)
14. [Friedman & Roosen (1995), An introduction to multivariate adaptive regression splines, Stat Methods Med Res 4(3):197–217](https://pubmed.ncbi.nlm.nih.gov/8548103/)
15. [Xinglong Ju and colleagues (2021). Fast knot optimization for multivariate adaptive regression splines using hill climbing methods. Expert Systems with Applications.](https://doi.org/10.1016/j.eswa.2021.114565)
16. [Modeling vector nonlinear time series using POLYMARS (Computational Statistics & Data Analysis)](https://www.sciencedirect.com/science/article/abs/pii/S0167947302001238)
17. [D. G. T. DENISON, B. K. MALLICK, A. F. M. SMITH (1998). Bayesian MARS. Statistics and Computing.](https://doi.org/10.1023/a:1008824606259)
18. [PETER J. GREEN (1995). Reversible jump Markov chain Monte Carlo computation and Bayesian model determination. Biometrika.](https://doi.org/10.1093/biomet/82.4.711)
19. [Rumsey, Kellin, Francom, Devin, Shen, Andy (2023). Generalized Bayesian MARS: Tools for Emulating Stochastic Computer Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2306.01911)
20. [Gerhard-Wilhelm Weber and colleagues (2011). CMARS: a new contribution to nonparametric regression with multivariate adaptive regression splines supported by continuous optimization. Inverse Problems in Science and Engineering.](https://doi.org/10.1080/17415977.2011.624770)
21. [Ayşe Özmen and colleagues (2011). RCMARS: Robustification of CMARS with different scenarios under polyhedral uncertainty set. Communications in Nonlinear Science and Numerical Simulation.](https://doi.org/10.1016/j.cnsns.2011.04.001)
22. [Elcin Kartal Koc and colleagues (2014). Efficient adaptive regression spline algorithms based on mapping approach with a case study on finance. Journal of Global Optimization.](https://doi.org/10.1007/s10898-014-0211-1)
23. [Haghighat, Parian and colleagues (2024). Fair Multivariate Adaptive Regression Splines for Ensuring Equity and Transparency. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2402.15561)
24. [MARS: A tutorial (Sekulic & Kowalski, Journal of Chemometrics 6(4):199–216, 1992)](https://analyticalsciencejournals.onlinelibrary.wiley.com/doi/10.1002/cem.1180060405)
25. [Comparative performance of generalized additive models and multivariate adaptive regression splines for statistical modelling of species distributions (Leathwick et al., Ecological Modelling)](https://www.sciencedirect.com/science/article/abs/pii/S0304380006002572)
26. [Comparing Methods for Multivariate Nonparametric Regression (CMU tech report, Prakash/?, comparative simulation study)](https://www.cs.cmu.edu/~bobski/pubs/tr99102.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/multivariate-adaptive-regression-splines

English original: https://www.edgepedia.org/multivariate-adaptive-regression-splines
