# 二次回归

二次回归是一种统计方法，它将二次多项式曲线 \( y = \beta_{0} + \beta_{1}x + \beta_{2}x^{2} + \varepsilon \) 拟合到数据上，从而可以估计和检验一个预测变量与结果变量之间的曲线关系。它是多项式回归中超越直线的最低阶成员，凡散点图呈现单一弯曲时都会用到：U形或倒U形效应、逐渐趋平的生长曲线，以及具有内部最优点的响应曲面。由于模型对系数 \( \beta_{0} \)、\( \beta_{1} \) 和 \( \beta_{2} \) 是线性的，它完全像多元线性回归一样用普通最小二乘法拟合。<sup>[1](https://online.stat.psu.edu/stat462/node/158/)</sup> 统计学家通常倾向于低阶多项式模型；阶数高于3或4并不常见，这使得二次式成为曲线拟合的主力工具。<sup>[2](https://r-resources.massey.ac.nz/161251/lectures/Polynomial.html)</sup>

| 关键事实 | 数值或表述 |
|---|---|
| 模型 | \( y = \beta_{0} + \beta_{1}x + \beta_{2}x^{2} + \varepsilon \)；对参数线性，故适用OLS<sup>[1](https://online.stat.psu.edu/stat462/node/158/)</sup> |
| 设计矩阵 | 列分别为1、\( x \)、\( x^{2} \)；标准多元回归机制<sup>[1](https://online.stat.psu.edu/stat462/node/158/)</sup> |
| 系数名称 | \( \beta_{1} \) 为线性效应参数，\( \beta_{2} \) 为二次效应参数<sup>[3](https://home.iitk.ac.in/~shalab/regression/Chapter12-Regression-PolynomialRegression.pdf)</sup> |
| 曲率符号 | \( \beta_{2} > 0 \) 给出凹向上的曲率；\( \beta_{2} < 0 \) 给出凹向下<sup>[4](https://bookdown.org/fmcron/RegressionAnalysis/a-quadratic-second-order-model-with-a-quantitative-predictor.html)</sup> |
| 多变量驻点 | \( x^{*} = -\tfrac{1}{2}B^{-1}b \)，由 \( B \) 的特征值判定极大值、极小值或鞍点<sup>[5](https://www.itl.nist.gov/div898/handbook/pri/section5/pri5314.htm)</sup> |
| 共线性代价 | 在一例中 \( \mathrm{cor}(x, x^{2}) = 0.968 \)，使两项的VIF均为15.8<sup>[6](https://master-statistics.com/machine-learning/polynomial-regression/)</sup> |
| 示例拟合 | 蓝鳃太阳鱼体长对年龄：二次模型解释了体长变异的80.1%<sup>[7](https://online.stat.psu.edu/stat462/node/159/)</sup> |

## 工作原理

二次模型假定结果变量的均值随预测变量变化的速率本身是线性变化的。系数 \( \beta_{1} \) 是线性效应参数，\( \beta_{2} \) 是二次效应参数。<sup>[3](https://home.iitk.ac.in/~shalab/regression/Chapter12-Regression-PolynomialRegression.pdf)</sup> \( \beta_{2} \) 的符号是系数中最主要可解释的信息：为正表示凹向上，为负表示凹向下。<sup>[4](https://bookdown.org/fmcron/RegressionAnalysis/a-quadratic-second-order-model-with-a-quantitative-predictor.html)</sup>

单个系数缺乏简单的“其他条件不变”解读，因为 \( x^{2} \) 随 \( x \) 变化而变化。实用的解释是在 \( x \) 给定变化量下的估计变化 \( \Delta \hat{Y} \)：在一个二次考试分数模型中，收入从10升至11预测提高2.96分，而从40升至41仅预测提高0.42分。<sup>[8](https://www.econometrics-with-r.org/8.2-nfoasiv.html)</sup> 有多个预测变量时，二阶曲面 \( \hat{y} = \beta_{0} + b' \cdot x + x' \cdot B \cdot x \) 的驻点在 \( x^{*} = -\tfrac{1}{2}B^{-1}b \)；若 \( B \) 的所有特征值为负，该点为极大值，全为正则为极小值，正负混合则为鞍点。<sup>[5](https://www.itl.nist.gov/div898/handbook/pri/section5/pri5314.htm)</sup>

## 如何操作

拟合归结为多元线性回归：设计矩阵包含列1、\( x \) 和 \( x^{2} \)，普通最小二乘法照常进行。<sup>[1](https://online.stat.psu.edu/stat462/node/158/)</sup> 在R中，平方项在 `lm()` 内用 `I(x^2)` 加入。<sup>[4](https://bookdown.org/fmcron/RegressionAnalysis/a-quadratic-second-order-model-with-a-quantitative-predictor.html)</sup>

检验是否需要二次项有几种等价方法。对 \( \beta_{2} \) 的t检验等价于III型F检验：在一个针对13个铜镍合金试样的SAS PROC GLM示例中，整体二次模型显著（F = 164.68，p < 0.0001，\( R^{2} \) = 0.970534），但二次项不显著（F = 0.28，p = 0.6107），因此可以将其剔除而保留显著的线性项。<sup>[9](https://www.sfu.ca/sasdoc/sashtml/stat/chap30/sect6.htm)</sup> 嵌套比较可直接进行：R中 `anova()` 比较线性与二次得到F = 87.779，p = 1.412e-06，而二次与三次比较不显著（p = 0.7059）。<sup>[10](https://bookdown.org/chua/ber642_advanced_regression/curvilinear-regression.html)</sup> 由于增加项总会提高 \( R^{2} \)，正确的原假设是 \( R^{2} \) 的增加不超过偶然水平；从 \( i \) 阶升至 \( j \) 阶的F统计量为 \( \mathrm{df}_{j} \cdot (R_{j}^{2} - R_{i}^{2}) / (1 - R_{j}^{2}) \)。<sup>[11](https://stats.libretexts.org/Bookshelves/Applied_Statistics/Biological_Statistics_%28McDonald%29/05%3A_Tests_for_Multiple_Measurement_Variables/5.03%3A_Curvilinear_%28Nonlinear%29_Regression)</sup> 层次原则要求：若保留 \( x^{2} \)，则线性项也必须保留，即使其单独不显著。<sup>[1](https://online.stat.psu.edu/stat462/node/158/)</sup>

中心化（在平方前减去 \( x \) 的均值）可降低 \( x \) 与 \( x^{2} \) 之间的相关性。在一个肥料-产量示例中，原始相关系数为0.968，两项的方差膨胀因子均为15.8，高于常用的5至10警戒阈值；中心化大幅降低了相关性，而正交多项式（R的 `poly()` 默认使用）几乎完全消除该相关性，且不改变拟合曲线。<sup>[6](https://master-statistics.com/machine-learning/polynomial-regression/)</sup> 中心化不改变预测值、残差或解释的方差；它只重新表达系数，使得中心化后 \( \beta_{1} \) 是结果变量在预测变量均值处的变化率。<sup>[12](https://mibur1.github.io/psy111/book/statistics/8_Polynomial_Reg/2_Centering_Predictors.html)</sup>

## 起源

最小二乘法是天文学和大地测量学中的标准工具。<sup>[13](https://hedibert.org/wp-content/uploads/2016/08/plackett1972-thediscoveryofthemethodofleastsquares.pdf)</sup><sup> • </sup><sup>[14](https://wolberg.net.technion.ac.il/files/2017/03/history.pdf)</sup> 多项式回归的实验设计出现在一篇已发表的论文中。<sup>[15](https://rwr.nrhstat.org/1_introduction.html)</sup> 回归的概念以略有不同的形式被重新发现为最小二乘法。<sup>[14](https://wolberg.net.technion.ac.il/files/2017/03/history.pdf)</sup> 最小二乘正交多项式的理论基础得以建立，但该方法真正变得实用是在后来的出版物之后，而后续工作完成了近一个世纪对实用方法的探索。<sup>[16](https://repository.up.ac.za/server/api/core/bitstreams/6c8f70c2-4b31-407a-b0d0-e60aa1a7e222/content)</sup> 在数字计算方面，George E. Forsythe（乔治·E·福赛思）1957年发表在《工业与应用数学学会杂志》上的论文《用数字计算机进行数据拟合的正交多项式的生成与使用》成为早期计算机上最小二乘拟合的参考方法。<sup>[17](https://doi.org/10.1137/0105007)</sup> Wishart（威沙特）和Metakides（梅塔基德斯）已于1953年在《生物计量学》上发表了正交多项式拟合算法。<sup>[18](https://doi.org/10.1093/biomet/40.3-4.361)</sup> 更广泛的线性模型框架后来由Nelder（内尔德）和Wedderburn（韦德伯恩）1972年发表在《皇家统计学会杂志A辑》上的广义线性模型所统一。<sup>[19](https://doi.org/10.2307/2344614)</sup>

## 变体

正交多项式回归用经Gram–Schmidt（格拉姆–施密特）构造正交化的多项式替代原始幂次 \( x, x^{2} \)，克服了随多项式阶数增长的 \( X' \cdot X \) 病态问题；即使中心化消除了一些病态性，高度多重共线性仍可能存在。<sup>[3](https://home.iitk.ac.in/~shalab/regression/Chapter12-Regression-PolynomialRegression.pdf)</sup> 二次模型的响应曲面设计分为20世纪50年代引入的两个经典类别：Box–Wilson（博克斯–威尔逊）中心复合设计和Box–Behnken（博克斯–本肯）设计；带中心点的两水平设计能检测但不能估计纯二次效应，因此每个因子至少需要三个水平。<sup>[20](https://www.itl.nist.gov/div898/handbook/pri/section3/pri336.htm)</sup> 正则化拟合使用岭回归，即Arthur E. Hoerl（阿瑟·E·霍尔）和Robert W. Kennard（罗伯特·W·肯纳德）1970年在《技术计量学》上发表的论文《岭回归：非正交问题的有偏估计》中引入的L2惩罚估计量。<sup>[21](https://doi.org/10.1080/00401706.1970.10488634)</sup>

## 应用

二次回归出现在预期存在单一弯曲的任何地方。在响应曲面方法学中，中心复合设计支持用于工业过程局部优化的二阶模型；一个化学实验示例拟合了编码单位下的 \( \hat{Y} = 72.0 - 11.78x_{1} + 0.74x_{2} - 7.25x_{1}^{2} - 7.55x_{2}^{2} - 4.85x_{1} \cdot x_{2} \)，特征值−4.973和−9.827表明存在极大值。<sup>[5](https://www.itl.nist.gov/div898/handbook/pri/section5/pri5314.htm)</sup> 在生物学中，体长对年龄的二次模型解释了明尼苏达州玛丽湖78条蓝鳃太阳鱼体长变异的80.1%，五龄鱼的95%预测区间为143.5至188.3毫米。<sup>[7](https://online.stat.psu.edu/stat462/node/159/)</sup> 在经济学中，库兹涅茨曲线假定收入不平等与人均GDP对数之间呈倒U形关系，常用二次多项式近似。<sup>[22](https://loyola.sites.oasis.unc.edu/soci709/m6/m6.html)</sup>

## 局限与替代方案

外推是主要风险。任何单变量多项式当 \( x \to \pm\infty \) 时都发散至 \( \pm\infty \)，使得多项式即使在观测范围稍外处也表现不佳。<sup>[23](https://www.refsmmat.com/courses/707/lecture-notes/nonlinear-regressors.html)</sup> 地鼠龟示例使这一点具体化：拟合的二次式确实优于不显著的线性拟合（\( R^{2} \) 0.43对0.015），但外推预测在背甲长度低于279毫米或高于343毫米时产卵数为负。<sup>[11](https://stats.libretexts.org/Bookshelves/Applied_Statistics/Biological_Statistics_%28McDonald%29/05%3A_Tests_for_Multiple_Measurement_Variables/5.03%3A_Curvilinear_%28Nonlinear%29_Regression)</sup> 在一个针对318名女孩的FEV对年龄示例中，四阶拟合在极端处显示出虚假的向上弯曲，这是多项式形式的产物而非数据的反映。<sup>[2](https://r-resources.massey.ac.nz/161251/lectures/Polynomial.html)</sup>

过拟合与阶数敏感性。\( n-1 \) 阶多项式可以完美拟合 \( n \) 个点，这几乎必然是过拟合。<sup>[24](https://www.sjsu.edu/faculty/guangliang.chen/Math261a/Ch7slides-polynomial-regression.pdf)</sup> 在回归断点分析中，控制分配变量的高阶多项式会产生噪声大的处理效应估计，且置信区间过窄；在一项中国燃煤取暖研究中，三次调整给出的预期寿命效应估计为5.5年（SE 2.4），而线性调整给出的估计为1.6年（SE 1.7）。<sup>[25](https://journals.sagepub.com/doi/10.1177/2053168015569830)</sup> 高阶拟合还会出现超出数据所暗示的Runge（龙格）型波动，且一个区域的拟合受远处点影响；尽管多项式在有限区间上可以近似对数型关系并可以近似阈值效应，但它们无法精确表示不连续的阈值。<sup>[26](https://stats.stackexchange.com/questions/549012/why-is-the-use-of-high-order-polynomials-for-regression-discouraged)</sup><sup> • </sup><sup>[29](https://mathworld.wolfram.com/WeierstrassApproximationTheorem.html)</sup>

替代方案。使用高于3或4阶并不常见，因为曲线变得过于灵活并在 \( x \) 的边界附近呈现奇怪形状。<sup>[27](https://datamineaz.org/readings/ISL_chp7.pdf)</sup> 回归样条通常给出更优结果，因为它们通过在固定阶数下增加节点来增加灵活性，而自然样条受约束在边界节点之外为线性，给出更稳定的估计和更窄的置信区间。<sup>[27](https://datamineaz.org/readings/ISL_chp7.pdf)</sup> 对于趋势数据，二次式建模跨时间的一条宽泛曲线，而分段（Joinpoint）回归建模特定点处的斜率变化，通常因更易解释和更灵活而更受青睐。<sup>[28](https://www.ncbi.nlm.nih.gov/books/NBK619731/)</sup> 在假设存在特定非线性机制时，推荐使用样条或高斯过程模型而非高阶多项式控制。<sup>[25](https://journals.sagepub.com/doi/10.1177/2053168015569830)</sup>

## References

1. [7.7 - Polynomial Regression | STAT 462 (Penn State)](https://online.stat.psu.edu/stat462/node/158/)
2. [Lecture 16 Polynomial Regression Models | Compiled Lectures for Regression Modelling (Massey University)](https://r-resources.massey.ac.nz/161251/lectures/Polynomial.html)
3. [Chapter 12: Regression, Polynomial Regression (Shalabh, IIT Kanpur)](https://home.iitk.ac.in/~shalab/regression/Chapter12-Regression-PolynomialRegression.pdf)
4. [6 A quadratic (second-order) model with a quantitative predictor | Applied regression analysis](https://bookdown.org/fmcron/RegressionAnalysis/a-quadratic-second-order-model-with-a-quantitative-predictor.html)
5. [5.5.3.1.4. Single response: Optimization when there is adequate quadratic fit (NIST/SEMATECH e-Handbook of Statistical Methods)](https://www.itl.nist.gov/div898/handbook/pri/section5/pri5314.htm)
6. [Polynomial Regression [Formula, Overfitting and Examples in R]](https://master-statistics.com/machine-learning/polynomial-regression/)
7. [7.8 - Polynomial Regression Examples | STAT 462 (Penn State)](https://online.stat.psu.edu/stat462/node/159/)
8. [8.2 Nonlinear Functions of a Single Independent Variable | Introduction to Econometrics with R](https://www.econometrics-with-r.org/8.2-nfoasiv.html)
9. [PROC GLM for Quadratic Least Squares Regression (SAS documentation)](https://www.sfu.ca/sasdoc/sashtml/stat/chap30/sect6.htm)
10. [Chapter 6 Curvilinear Regression | Companion to BER 642](https://bookdown.org/chua/ber642_advanced_regression/curvilinear-regression.html)
11. [5.03: Curvilinear (Nonlinear) Regression (stats.libretexts.org)](https://stats.libretexts.org/Bookshelves/Applied_Statistics/Biological_Statistics_%28McDonald%29/05%3A_Tests_for_Multiple_Measurement_Variables/5.03%3A_Curvilinear_%28Nonlinear%29_Regression)
12. [12.2 Centering Predictors, Multivariate Statistics with Python](https://mibur1.github.io/psy111/book/statistics/8_Polynomial_Reg/2_Centering_Predictors.html)
13. [Studies in the History of Probability and Statistics. XXIX: The Discovery of the Method of Least Squares (R. L. Plackett, 1972)](https://hedibert.org/wp-content/uploads/2016/08/plackett1972-thediscoveryofthemethodofleastsquares.pdf)
14. [The Method of Least Squares (introduction chapter, J. R. Wolberg)](https://wolberg.net.technion.ac.il/files/2017/03/history.pdf)
15. [Introduction – Regression with R (book chapter on the history of regression)](https://rwr.nrhstat.org/1_introduction.html)
16. [Curve Fitting by the Orthogonal Polynomials of Least Squares (University of Pretoria repository)](https://repository.up.ac.za/server/api/core/bitstreams/6c8f70c2-4b31-407a-b0d0-e60aa1a7e222/content)
17. [George E. Forsythe (1957). Generation and Use of Orthogonal Polynomials for Data-Fitting with a Digital Computer. Journal of the Society for Industrial and Applied Mathematics.](https://doi.org/10.1137/0105007)
18. [JOHN WISHART, THEOCHARIS METAKIDES (1953). ORTHOGONAL POLYNOMIAL FITTING. Biometrika.](https://doi.org/10.1093/biomet/40.3-4.361)
19. [J. A. Nelder, R. W. M. Wedderburn (1972). Generalized Linear Models. Journal of the Royal Statistical Society Series A (General).](https://doi.org/10.2307/2344614)
20. [5.3.3.6. Response surface designs (NIST/SEMATECH e-Handbook of Statistical Methods)](https://www.itl.nist.gov/div898/handbook/pri/section3/pri336.htm)
21. [Arthur E. Hoerl, Robert W. Kennard (1970). Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics.](https://doi.org/10.1080/00401706.1970.10488634)
22. [SOC 209/709 Module 6 - Polynomial Regression & Interactions (UNC)](https://loyola.sites.oasis.unc.edu/soci709/m6/m6.html)
23. [Nonlinear Regressors – 36-707 Regression Analysis (CMU course notes)](https://www.refsmmat.com/courses/707/lecture-notes/nonlinear-regressors.html)
24. [Polynomial Regression Models, San José State University Math 261A](https://www.sjsu.edu/faculty/guangliang.chen/Math261a/Ch7slides-polynomial-regression.pdf)
25. [Evidence on the deleterious impact of sustained use of polynomial regression on causal inference (Sage Political Analysis)](https://journals.sagepub.com/doi/10.1177/2053168015569830)
26. [Why is the use of high order polynomials for regression discouraged? (Cross Validated)](https://stats.stackexchange.com/questions/549012/why-is-the-use-of-high-order-polynomials-for-regression-discouraged)
27. [An Introduction to Statistical Learning, Chapter 7: Moving Beyond Linearity](https://datamineaz.org/readings/ISL_chp7.pdf)
28. [Polynomial Versus Piecewise Regression: Similarities and Differences (NCHS Vital and Health Statistics, Series 2, No. 213, 2025)](https://www.ncbi.nlm.nih.gov/books/NBK619731/)
29. [Weierstrass Approximation Theorem -- from Wolfram MathWorld](https://mathworld.wolfram.com/WeierstrassApproximationTheorem.html)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 25, 2026*

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/quadratic-regression

English original: https://www.edgepedia.org/quadratic-regression
