# 核（统计学）

在统计学中，**核**是一种加权函数，用于从数据出发构建非参数估计；这个词同时也指代若干相关但彼此不同的对象：密度估计与核回归中的平滑核、再生核希尔伯特空间方法中的正定核、马尔可夫过程的转移核，以及贝叶斯计算中密度的核。这些用法的共同之处在于，它们都体现了用函数提供权重或条件分布的观念，而不是拟合于数据的参数模型。

| 关键事实 | 详情 |
|---|---|
| 平滑核 | 一个函数 K: ℝ → [0, ∞)，积分为一且对称，即 K(u) = K(−u)；高斯核 K(u) = (2π)^{−1/2} e^{−u²/2} 是常见选择<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup> |
| 核密度估计量 | \( \hat{f}_{h}(y) = \frac{1}{N} \sum_{i=1}^{N} K_{h}(y - y_{i}) \)，其中 \( K_{h}(u) = K(u/h)/h \)；每个观测贡献一个缩放后的小丘<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup> |
| 带宽速率 | 对于高斯核与独立同分布数据，当 h → 0 时，光滑内点处的偏差为 O(h²)，方差为 O(1/(Nh))<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup> |
| 经验法则 | 高斯核下 \( h = 0.9 \cdot \min(\hat{\sigma}, \widehat{\mathrm{IQR}}/1.34) \cdot N^{-1/5} \)<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup> |
| 起源 | 默里·罗森布拉特（Murray Rosenblatt）于1956年引入密度的核估计；伊曼纽尔·帕尔岑（Emanuel Parzen）1962年的论文确立了相合性与渐近正态性<sup>[2](https://www.minicod.com/papers/remarks-on-some-nonparametric-estimates-of-a-density-function-2f304cb0)</sup><sup> • </sup><sup>[3](https://www.resea.org/10.1214/aoms/1177704472)</sup> |
| 核回归 | 纳达拉亚–沃森（Nadaraya–Watson）估计量通过在 x 处对观测结果做加权平均来进行预测，权重正比于 K_h(x − x_i)<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup><sup> • </sup><sup>[4](https://www.jstor.org/stable/25049340?googleloggedin=true)</sup> |
| 其他含义 | 正定核定义用于机器学习的再生核希尔伯特空间；马尔可夫（转移）核为每个状态指定一个概率分布；在贝叶斯工作中，密度的核是识别其分布族的因子<sup>[5](https://pure.psu.edu/en/publications/kernel-mean-embedding-of-distributions-a-review-and-beyond/)</sup><sup> • </sup><sup>[6](https://ncatlab.org/nlab/show/Markov%2Bkernel)</sup><sup> • </sup><sup>[7](https://st540.wordpress.ncsu.edu/files/2025/02/lab4_completed.pdf)</sup> |

## 平滑核与密度估计

平滑核赋予邻近观测比远处观测更大的权重。形式上，它是一个函数 K: ℝ → [0, ∞)，积分为一且关于零对称；高斯核、标准正态密度以及区间上的均匀密度都是典型选择<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。核密度估计量（KDE）在每个观测数据点处放置一个核的缩放副本——一个小丘——然后将这些丘求和：

\[ \hat{f}_{h}(y) = \frac{1}{N} \sum_{i=1}^{N} K_{h}(y - y_{i}), \qquad K_{h}(u) = \frac{1}{h} K\!\left( \frac{u}{h} \right). \]

使用高斯核时，每个丘都是以某个观测为中心、标准差为 h 的正态密度，再按 1/N 缩放。由于每个丘非负且积分为 1/N，估计量本身就是一个概率密度；因子 1/h 在丘变宽或变窄时保持该面积不变<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。该方法可视为直方图的改进：罗森布拉特–帕尔岑估计量被描述为经过适当平滑的直方图，其中 K 是固定的有界密度（如均匀密度或标准正态密度），带宽序列 h_N 随样本量增大而趋于零<sup>[8](https://www.sciencedirect.com/topics/mathematics/kernel-estimator)</sup>。

两个极限情形展示了带宽控制的是什么。当 h → 0 时，丘集中在观测点处，估计量趋近于经验分布，每个观测点处质量为 1/N。当 h → ∞ 时，质量扩散开来，密度在任何固定的有界范围内趋于零。对于每个有限的 h > 0，估计量仍然积分为一<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。

## 带宽与偏差–方差权衡

带宽 h 远比核的选择更能决定估计量所表达的内容。小带宽使每个点处少数观测获得可观权重，因此估计噪声大、方差高；大带宽在宽范围内平均，模糊了峰值等真实特征，导致高偏差<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。对于高斯核、独立同分布观测以及密度二阶连续可导的固定内点，当 h → 0 时偏差为 O(h²)，方差为 O(1/(Nh))。要同时减小二者，需要 h → 0 而 Nh → ∞（随样本增长），因此更窄的邻域仍须包含足够多的观测<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。

实践中，h 由经验法则选取，例如高斯核下 \( h = 0.9 \cdot \min(\hat{\sigma}, \widehat{\mathrm{IQR}}/1.34) \cdot N^{-1/5} \)，其中 \( \hat{\sigma} \) 为样本标准差，\( \widehat{\mathrm{IQR}} \) 为四分位距；也可用交叉验证选取<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。在 d 维情形下，若核为乘积形式、带宽为矩阵 H，则渐近最优带宽的阶为 \( n^{-1/(d+4)} \)，最优平均积分平方误差的阶为 \( n^{-4/(d+4)} \)；当 d 超过 2 或 3 时收敛非常缓慢，这就是维数灾难<sup>[9](https://homepage.stat.uiowa.edu/~luke/classes/STAT7400-2020/modules/mod_smooth.pdf)</sup>。

## 核回归

同样的加权思想可用于估计条件均值。给定数据对 \( (x_1, y_1), \ldots, (x_N, y_N) \)，纳达拉亚–沃森估计量通过在 x 处对观测结果做加权平均来进行预测，

\[ \hat{m}_{h}(x) = \sum_{i=1}^{N} w_{i}(x) \, y_{i}, \qquad w_{i}(x) = \frac{K_{h}(x - x_{i})}{\sum_{j=1}^{N} K_{h}(x - x_{j})}. \]

分母必须为正：高斯核在样本非空时保证这一点，而紧支撑核（如均匀核）在窗口内没有观测时会使估计量无定义<sup>[1](https://mlmetrics.org/kernel_smoothing.html)</sup>。该估计量也可视为局部常数拟合，即最小化加权残差平方和 \( \sum w_{i}(x)(y_{i} - \beta_{0})^{2} \) 的取值 β₀；更高阶的局部多项式估计量推广了这一做法，而局部线性拟合（一阶）通常效果良好<sup>[9](https://homepage.stat.uiowa.edu/~luke/classes/STAT7400-2020/modules/mod_smooth.pdf)</sup>。沃森（Watson）1964年发表于《Sankhyā》A辑的论文《光滑回归分析》是该方法的两篇奠基论文之一<sup>[4](https://www.jstor.org/stable/25049340?googleloggedin=true)</sup>。

## 边界偏差

所有核平滑方法共有的一个问题是边界偏差，它出现在被估计密度支撑集的端点附近。在边界处，分配给观测的核权重变得不对称，平均区间越过边界延伸到没有观测的区域，因此估计量在边界点与内点的表现不同<sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC5978534/)</sup>。受影响区域随带宽增大：噪声与样本量之比越大，或目标函数越光滑，带宽越大，受影响的边界区域也越大<sup>[11](https://www.sciencedirect.com/science/article/abs/pii/S0167947310001519)</sup>。

修正方法包括边界核——在边缘附近用专门构造的核替换对称核——以及局部带宽变化，即在边界附近缩小带宽；一项关于带宽变化方法的模拟研究发现，在中小样本量下，该方法在密度估计与回归估计中表现良好<sup>[10](https://pmc.ncbi.nlm.nih.gov/articles/PMC5978534/)</sup><sup> • </sup><sup>[11](https://www.sciencedirect.com/science/article/abs/pii/S0167947310001519)</sup>。

## 正定核与机器学习中的核方法

该词的第二种不同用法是正定核：定义在空间 𝒳 × 𝒳 上的实值函数 k(x, y)，用于量化两点之间的相似程度。核方法是估计形如 \( f(x) = \sum_{i \in I} \alpha_{i} \, k(x_{i}, x) \) 的函数的算法，即在观测点上核求值的展开；这类方法是数据驱动的、非参数的，且当 k 为非线性（如高斯核 \( k(x, y) = \exp(-\|x - y\|^{2}/(2\sigma^{2})) \)）时为非线性<sup>[12](https://arxiv.org/abs/0911.5367)</sup>。

每个正定核确定一个再生核希尔伯特空间（RKHS），这是一个函数空间，其中任何函数在某点的值都可通过与该点处的核函数取内积来恢复<sup>[13](https://doi.org/10.1073/PNAS.2522504123)</sup>。在此基础上，**核均值嵌入**将整个概率分布映射到 RKHS 中：它是满足对所有空间中的 f 有 \( \langle m_{\mathbb{P}}, f \rangle = \int f \, d\mathbb{P} \) 的唯一元素 m_P。当核为通用核时，该映射是单射，因此嵌入完全刻画了分布<sup>[13](https://doi.org/10.1073/PNAS.2522504123)</sup>。该框架推广了支持向量机的特征映射，并支持核双样本检验、独立性检验、因果发现以及分布数据上的学习等应用<sup>[5](https://pure.psu.edu/en/publications/kernel-mean-embedding-of-distributions-a-review-and-beyond/)</sup>。两个嵌入测度之间的距离定义了最大均值差异（MMD），其性质与核文献中的通用核、特征核和严格正定核概念相关联<sup>[14](https://www.jmlr.org/papers/v19/16-291.html)</sup>。

## 转移核

在概率论中，马尔可夫核（也称转移核、随机核或概率核）通过为每个输入状态指定可能输出的概率分布来描述随机状态转移<sup>[6](https://ncatlab.org/nlab/show/Markov%2Bkernel)</sup>。对于马尔可夫过程 \( (X_t) \)，转移核为 \( P_{t}(x, A) = \mathbb{P}(X_{t} \in A \mid X_{0} = x) \)，对每个 x，它作为 A 的函数是一个概率测度；当存在参考测度时，核通常有转移密度 \( p_{t}(x, y) \)<sup>[15](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/16%3A_Markov_Processes/16.01%3A_Introduction_to_Markov_Processes)</sup>。齐次马尔可夫过程的转移核满足查普曼–科尔莫戈罗夫方程 \( P_{s} P_{t} = P_{s+t} \)，这正是其名称的由来<sup>[15](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/16%3A_Markov_Processes/16.01%3A_Introduction_to_Markov_Processes)</sup>。在离散情形下，核退化为行和为1的转移概率矩阵。

## 贝叶斯工作中密度的核

第四种用法出现在贝叶斯计算中。当后验密度通过代数推导得出时，不依赖于参数的因子被丢弃，剩余因子称为密度的核；识别该核即可确定后验的分布族及其归一化常数<sup>[7](https://st540.wordpress.ncsu.edu/files/2025/02/lab4_completed.pdf)</sup>。这一用法纯粹是代数性的，与平滑核或正定核无关，这也是读者在不同教材中遇到该词时常常混淆的来源。

## References

1. [Kernel Smoothing: The Basic Idea, MLmetrics: Machine Learning for Econometricians](https://mlmetrics.org/kernel_smoothing.html)
2. [Murray Rosenblatt (1956). Remarks on Some Nonparametric Estimates of a Density Function. The Annals of Mathematical Statistics.](https://www.minicod.com/papers/remarks-on-some-nonparametric-estimates-of-a-density-function-2f304cb0)
3. [Emanuel Parzen (1962). On Estimation of a Probability Density Function and Mode. The Annals of Mathematical Statistics.](https://www.resea.org/10.1214/aoms/1177704472)
4. [Geoffrey S. Watson (1964). Smooth Regression Analysis. Sankhyā: The Indian Journal of Statistics, Series A, Vol. 26, No. 4, pp. 359–372.](https://www.jstor.org/stable/25049340?googleloggedin=true)
5. [Krikamol Muandet, Kenji Fukumizu, Bharath Sriperumbudur, Bernhard Schölkopf (2017). Kernel mean embedding of distributions: A review and beyond. Foundations and Trends in Machine Learning 10(1–2).](https://pure.psu.edu/en/publications/kernel-mean-embedding-of-distributions-a-review-and-beyond/)
6. [Markov kernel, nLab](https://ncatlab.org/nlab/show/Markov%2Bkernel)
7. [ST440/540 Applied Bayesian Analysis, Lab 4, North Carolina State University](https://st540.wordpress.ncsu.edu/files/2025/02/lab4_completed.pdf)
8. [Kernel Estimator, an overview, ScienceDirect Topics](https://www.sciencedirect.com/topics/mathematics/kernel-estimator)
9. [Luke Tierney, Computer Intensive Statistics STAT:7400, Spring 2020, University of Iowa](https://homepage.stat.uiowa.edu/~luke/classes/STAT7400-2020/modules/mod_smooth.pdf)
10. [Examining Potential Boundary Bias Effects in Kernel Smoothing on Equating: An Introduction for the Adaptive and Epanechnikov Kernels, PMC](https://pmc.ncbi.nlm.nih.gov/articles/PMC5978534/)
11. [Simple and effective boundary correction for kernel densities and regression, Computational Statistics & Data Analysis 54(11), 2487–2497 (2010)](https://www.sciencedirect.com/science/article/abs/pii/S0167947310001519)
12. [Positive Definite Kernels in Machine Learning, arXiv](https://arxiv.org/abs/0911.5367)
13. [Kernel embeddings and the separation of measure phenomenon, PNAS](https://doi.org/10.1073/PNAS.2522504123)
14. [Simon-Gabriel, C.-J., Schölkopf, B. (2018). Kernel Distribution Embeddings: Universal Kernels, Characteristic Kernels and Kernel Metrics on Distributions. JMLR 19(44):1–29.](https://www.jmlr.org/papers/v19/16-291.html)
15. [16.1: Introduction to Markov Processes, Statistics LibreTexts](https://stats.libretexts.org/Bookshelves/Probability_Theory/Probability_Mathematical_Statistics_and_Stochastic_Processes_%28Siegrist%29/16%3A_Markov_Processes/16.01%3A_Introduction_to_Markov_Processes)

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

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Estimation theory and estimator families › Estimation: overview

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/kernel-statistics

English original: https://www.edgepedia.org/kernel-statistics
