# 平均绝对误差

**平均绝对误差**（MAE）是一种衡量预测精度的指标，定义为预测值与相应真实值之间绝对差的平均值。在预测记法中，MAE = mean(|e_t|)，其中 e_t 为时刻 t 的预测误差；其一般形式为 \( \mathrm{MAE} = \frac{1}{n} \sum_{i=1}^{n} |\epsilon_i| \)，即误差大小的均值，不计正负号。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup><sup> • </sup><sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup> 它与均方根误差（RMSE）并列为最常用的两种依赖于标度的精度指标。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | \( \mathrm{MAE} = \frac{1}{n} \sum_{i=1}^{n} |\epsilon_i| \)，即忽略正负号的误差平均幅度<sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup> |
| 取值范围 | 非负；最优值为 0.0<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html)</sup> |
| 标度依赖性 | MAE 与 RMSE 均依赖于标度：将所有数据乘以因子 k，指标也随之乘以 k；MAPE 与 sMAPE 则不然<sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup> |
| 最优点预测 | 使 MAE 最小的方法产生中位数的预测；使 RMSE 最小则产生均值的预测<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup> |
| 离群值行为 | 平方误差类指标对离群误差敏感；基于 MAE 选择模型，较不易受少量大误差的影响<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)</sup> |
| 标度化变体 | 平均绝对标度误差（MASE）由 Hyndman 与 Koehler（2006）提出，将模型的 MAE 除以朴素参考预测的平均绝对误差<sup>[5](https://doi.org/10.1016/j.ijforecast.2006.03.001)</sup><sup> • </sup><sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)</sup> |
| 业务使用 | 世界气象组织（WMO）确定性数值天气预报检验牵头中心将 MAE 定义为对预报值与实况值的加权平均 \( \mathrm{MAE} = \frac{1}{S_w} \sum_{i=1}^{n} w_i |x_f - x_v|_i \)<sup>[6](https://confluence.ecmwf.int/spaces/WLD/pages/97370550/Score%2Bdefinitions%2Band%2Brequirements)</sup> |

## 解读

MAE 回答的是一个直截了当的问题：平均而言，一个预测值距离它所预测的值有多远——以数据的单位来衡量？这种线性特征使 MAE 易于理解和计算，因此在对单一时间序列或以相同单位表示的若干序列比较预测方法时，它颇受欢迎。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup>

由于它是绝对值的平均，MAE 始终非负，且仅当每一个预测都完全正确时才等于 0.0。<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html)</sup> 与 RMSE 一样，它依赖于标度：对于一个数值达几千的量，MAE 为 1 算小；而对于一个数值只有零点几的量，MAE 为 1 则算大。因此，这个数值只有相对于数据的标度才有意义。<sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup>

## MAE 与中位数

在 MAE 与平方误差类指标之间做选择并非任意；两者分别由数据的不同概括量取到最小值。使 MAE 最小的预测方法将给出中位数预测，而使 RMSE 最小则给出均值预测。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup> 同样的关系也出现在贝叶斯决策理论中：在绝对误差损失 \( L(\theta, a) = |a - \theta| \) 下，贝叶斯估计量为后验中位数；而平方误差损失则给出后验均值。<sup>[7](https://link.springer.com/chapter/10.1007/978-3-030-83640-5_1)</sup><sup> • </sup><sup>[8](https://www.lancaster.ac.uk/~prendivs/accessible/math331/lectures.tex/Ch5.S3.html)</sup> 绝对损失将高估与低估视为同等代价。<sup>[7](https://link.springer.com/chapter/10.1007/978-3-030-83640-5_1)</sup>

这一联系也解释了 MAE 的稳健性。平方误差类指标对离群预测误差敏感；而由于当损失函数为绝对值时，中位数使期望损失最小，因此以 MAE 为标准选择预测模型，比以平方误差为标准更不易受少量大预测误差的影响。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)</sup>

## 与相关指标的比较

**RMSE。** RMSE 是平方误差均值的平方根，即 \( \sqrt{\frac{1}{n} \sum_{i=1}^{n} \epsilon_i^2} \)，对较大误差的惩罚比 MAE 更重。<sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup>

**百分比误差。** MAPE 与 sMAPE 将误差表示为相对于观测值的比例，因此无量纲，可用于跨数据集的比较。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup><sup> • </sup><sup>[2](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)</sup> 它们有已知的局限：当任一观测值为零时，百分比误差为无穷大或无定义；在接近零时取极端值；并且假定计量单位具有有意义的零点，而这对于华氏度或摄氏度等温标并不成立。<sup>[1](https://otexts.com/fpp2/accuracy.html)</sup>

**标度化与相对误差。** 为在标度各异的多个时间序列之间比较精度，莫纳什大学统计学教授 Rob J. Hyndman 与 Anne B. Koehler 在 2006 年发表于《国际预测学刊》的论文中提出，应以平均绝对标度误差作为标准指标。<sup>[5](https://doi.org/10.1016/j.ijforecast.2006.03.001)</sup> MASE 是模型平均绝对残差与观测序列平均绝对一阶差分之比，\( \mathrm{MASE} = \frac{\sum_{t=1}^{T} |y_t - \hat{\mu}_t| / T}{\sum_{t=2}^{T} |y_t - y_{t-1}| / (T-1)} \)，等价于相对于朴素滞后 1 期参考模型的相对 MAE。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)</sup> 模型 A 与模型 B 在预测步长 h 上更一般的相对 MAE 为 \( \mathrm{relMAE}_{A,B,h} = \mathrm{MAE}_{A,h} / \mathrm{MAE}_{B,h} \)，这一扩展避免了固定朴素参考在周期性系统的长预测步长上所遇到的问题。<sup>[4](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)</sup>

## 实际应用

MAE 作为标准回归指标在机器学习库中均有实现。在 scikit-learn 中，`sklearn.metrics.mean_absolute_error(y_true, y_pred)` 接受可选的 `sample_weight` 以及一个 `multioutput` 参数，后者控制多个输出的误差如何聚合：`uniform_average` 以相同权重对所有输出误差取平均，`raw_values` 分别返回每个输出的误差，类数组参数则提供自定义权重。对于示例目标值 y_true = [3, -0.5, 2, 7] 与预测值 [2.5, 0.0, 2, 8]，该函数返回 0.5。<sup>[3](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html)</sup>

在数值天气预报中，MAE 是标准的确定性检验评分之一。WMO 确定性数值天气预报检验牵头中心规定了加权形式 \( \mathrm{MAE} = \frac{1}{S_w} \sum_{i=1}^{n} w_i |x_f - x_v|_i \)，其中 \( x_f \) 为预报值，\( x_v \) 为实况值，权重在针对分析场检验时为纬度余弦，针对观测检验时则为等权重。<sup>[6](https://confluence.ecmwf.int/spaces/WLD/pages/97370550/Score%2Bdefinitions%2Band%2Brequirements)</sup>

对任何绝对标度指标都有一点需要注意：由于 MAE 无界且依赖于标度，若无基线，单个模型的 MAE 值意义甚微。

## 历史

最小化绝对误差之和是统计学中最古老的客观方法之一。最小绝对偏差法归功于 Boscovich（1757 年与 1760 年），而相关的最小最大绝对残差估计程序最早由 Laplace 于 1786 年提出，并在其后四十年间由 de Prony、Cauchy、Fourier 以及 Laplace 本人加以发展。<sup>[9](https://www.york.ac.uk/depts/maths/histstat/haldcontents.htm)</sup><sup> • </sup><sup>[10](https://www.sciencedirect.com/science/article/pii/S0167947396000710)</sup> Laplace 进一步证明，当观测数量众多时，在其准则下最小化绝对误差与最小化平方误差给出相同结果——这一原理 Gauss 已于 1809 年给出论证。<sup>[11](https://catalogimages.wiley.com/images/db/pdf/9781119127925.excerpt.pdf)</sup> 平均绝对残差至今仍是现代实践中标准的拟合优度统计量，其可贵之处在于：与绝对残差之和不同，它不随样本量增长。<sup>[12](https://itl.nist.gov/div898/handbook/pri/section5/pri5992.htm)</sup>

## References

1. [Evaluating forecast accuracy, Forecasting: Principles and Practice, 2nd ed. (Hyndman & Athanasopoulos)](https://otexts.com/fpp2/accuracy.html)
2. [Forecast Evaluation Methods, Principles of Data Science, OpenStax](https://openstax.org/books/principles-data-science/pages/5-4-forecast-evaluation-methods)
3. [sklearn.metrics.mean_absolute_error, scikit-learn documentation](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.mean_absolute_error.html)
4. [Case study in evaluating time series prediction models using the relative mean absolute error, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC5270768/)
5. [Rob J. Hyndman and Anne B. Koehler (2006). Another look at measures of forecast accuracy. International Journal of Forecasting 22(4), 679-688.](https://doi.org/10.1016/j.ijforecast.2006.03.001)
6. [Score definitions and requirements, WMO Lead Centre for Deterministic NWP Verification, ECMWF Confluence](https://confluence.ecmwf.int/spaces/WLD/pages/97370550/Score%2Bdefinitions%2Band%2Brequirements)
7. [Introduction to Bayesian Statistical Inference, Springer Nature Link](https://link.springer.com/chapter/10.1007/978-3-030-83640-5_1)
8. [Decision theory for point estimation, Lancaster University MATH331 lectures](https://www.lancaster.ac.uk/~prendivs/accessible/math331/lectures.tex/Ch5.S3.html)
9. [A history of mathematical statistics from 1750 to 1930 (Hald), table of contents, University of York](https://www.york.ac.uk/depts/maths/histstat/haldcontents.htm)
10. [The historical development of the linear minimax absolute residual estimation procedure 1786-1960, Computational Statistics & Data Analysis](https://www.sciencedirect.com/science/article/pii/S0167947396000710)
11. [Wiley excerpt on Laplace and least squares (9781119127925)](https://catalogimages.wiley.com/images/db/pdf/9781119127925.excerpt.pdf)
12. [Motivation: How do we Construct a Goodness-of-fit Metric for a Model?, NIST/SEMATECH e-Handbook](https://itl.nist.gov/div898/handbook/pri/section5/pri5992.htm)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Bayesian statistics › Bayesian probability and inference foundations › Bayesian estimation and filtering › Loss functions and Bayes risk

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/mean-absolute-error

English original: https://www.edgepedia.org/mean-absolute-error
