# 得分函数

在统计学中，**得分函数**（或简称得分）是对数似然函数关于统计模型参数的梯度。对于从密度 \( f(x \mid \theta) \) 中独立抽取的样本 \( X_1, \ldots, X_n \)，对数似然为 \( \ell(\theta) = \sum_{i=1}^{n} \log f(x_i \mid \theta) \)，而得分为其关于 \( \theta \) 的导数，\( \Psi(\theta) = \ell'(\theta) \)。令得分等于零，即得到用于求最大似然估计量（MLE）的似然方程<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup><sup> • </sup><sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup>。该术语可追溯至罗纳德·费雪（Ronald Fisher）1922年的工作，他确立了似然作为参数信息之定量度量的地位<sup>[3](https://errorstatistics.com/wp-content/uploads/2021/04/fisher-1922.pdf)</sup>。

| 关键事实 | 细节 |
|---|---|
| 定义 | \( s(\theta) = \nabla_\theta \ell(\theta) = \sum_{i=1}^{n} \nabla_\theta \log p(X_i; \theta) \)；对于 \( d \) 维参数，这是一个 \( d \) 维向量<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup> |
| 零均值 | 在正则条件下，\( \mathrm{E}_\theta[\Psi(\theta \mid X)] = 0 \)<sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup> |
| 费雪信息 | \( I(\theta) = \mathrm{E}[s(\theta) s(\theta)^T] \)，即得分的协方差矩阵；对于独立同分布样本，\( I_n(\theta) = n I_1(\theta) \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup> |
| 伯努利示例 | 对于 \( X \sim \mathrm{Ber}(p) \)，\( s(p) = (X - p)/(p(1-p)) \)，\( I(p) = 1/(p(1-p)) \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup> |
| 高斯示例 | 对于 \( X \sim N(\mu, \sigma^2) \) 且 \( \sigma \) 已知，\( s(\mu) = (X - \mu)/\sigma^2 \)，\( I(\mu) = 1/\sigma^2 \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup> |
| 估计下界 | 克拉美–罗不等式：在正则条件下，无偏估计量满足 \( \mathrm{Var}_\theta(W(X)) \ge 1/(n I(\theta)) \)<sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup> |
| 得分检验 | 由C. R. 拉奥（C. R. Rao）于1948年提出，作为似然比检验和瓦尔德检验的替代方案；三者渐近等价<sup>[4](https://arxiv.org/abs/2406.19956)</sup><sup> • </sup><sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)</sup> |

## 定义与基本性质

对于参数模型 \( \{ f(x \mid \theta) : \theta \in \Theta \} \)，单个观测的得分为 \( \ell'(\theta) = \frac{\partial}{\partial \theta} \log f(x \mid \theta) \)，而随机样本的得分为给定样本下对数似然的导数，即各观测得分之和<sup>[6](https://stat135.berkeley.edu/spring-2026/lectures/lecture-14.html)</sup>。在多变量情形下，得分是一个 \( k \) 维列向量，其第 \( i \) 个分量是对数似然关于第 \( i \) 个参数的导数<sup>[7](https://sas.uwaterloo.ca/~dlmcleis/book/appendixb.htm)</sup>。

**得分的均值为零。** 由于密度函数积分为一，在积分号下对 \( \int p(x;\theta)\,dx = 1 \) 求导（这需要正则条件，如共同支撑集以及导数与积分可交换），可得 \( \mathrm{E}_\theta[s(\theta)] = 0 \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup><sup> • </sup><sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup>。因此，得分衡量的是数据将参数从任一试探值拉开的力度：在真实参数处，平均拉力为零；而在最大似然估计处，对于内点解，实际得分恰好为零。

## 与费雪信息的关系

费雪信息是得分的方差。在一维情形下，\( I(\theta) = \mathrm{E}_\theta[(\partial \log f(X \mid \theta)/\partial \theta)^2] \)；在多维情形下，它是期望外积 \( I(\theta) = \mathrm{E}[s(\theta) s(\theta)^T] \)，一个 \( d \times d \) 矩阵<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup><sup> • </sup><sup>[6](https://stat135.berkeley.edu/spring-2026/lectures/lecture-14.html)</sup>。由于均值为零，该期望等于得分的协方差矩阵<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup>。

在正则条件下还有两个恒等式成立。第一，对于独立同分布样本，信息可加：\( I_n(\theta) = n I_1(\theta) \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup>。第二，信息等于对数似然负的期望海森矩阵，\( I_1(\theta) = -\mathrm{E}[\nabla_\theta^2 \log p(X;\theta)] \)，因此它衡量的是对数似然在 \( \theta \) 附近的期望曲率；对数似然曲率越大，\( \theta \) 越容易估计，而最大似然估计的渐近方差为 \( 1/I(\theta_0) \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup><sup> • </sup><sup>[6](https://stat135.berkeley.edu/spring-2026/lectures/lecture-14.html)</sup>。观测信息——在估计值处而非期望下计算的负二阶导数——是用于标准误的样本特定对应物<sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup>。

得分的方差出现在克拉美–罗不等式中，该不等式给出任何正则无偏估计量方差的下界 \( 1/(n I(\theta)) \)<sup>[2](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)</sup>。

## 具体示例

对于伯努利观测 \( X \sim \mathrm{Ber}(p) \)，对数似然为 \( \ell(p) = X \log p + (1-X) \log(1-p) \)，给出得分 \( s(p) = X/p - (1-X)/(1-p) = (X - p)/(p(1-p)) \) 和费雪信息 \( I(p) = 1/(p(1-p)) \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup>。

对于方差已知的高斯观测，\( \ell(\mu) = -(X-\mu)^2/(2\sigma^2) \)，因此 \( s(\mu) = (X - \mu)/\sigma^2 \)，\( I(\mu) = 1/\sigma^2 \)<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup>。对于指数族，信息矩阵等于对数配分函数海森矩阵的 \( n \) 倍，等价地等于充分统计量的协方差矩阵<sup>[1](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)</sup>。

## 得分检验与渐近三位一体

C. 拉德哈克里希纳·拉奥（C. Radhakrishna Rao）当时在剑桥大学国王学院，他在1948年关于大样本检验的论文中引入了得分检验统计量，作为似然比统计量和瓦尔德统计量的替代方案，并定义了有效得分 \( \phi_i = \partial \log L / \partial \theta_i \)<sup>[8](https://www.cambridge.org/core/journals/mathematical-proceedings-of-the-cambridge-philosophical-society/article/abs/large-sample-tests-of-statistical-hypotheses-concerning-several-parameters-with-applications-to-problems-of-estimation/B83FAA6838A7E7D933EA3582C784ED06)</sup><sup> • </sup><sup>[9](https://gwern.net/doc/statistics/1948-rao.pdf)</sup>。该检验在原假设下评估得分：如果受约束模型已经拟合良好，那么在约束最优解处对数似然的梯度应接近零，而该统计量用信息对此梯度进行标准化<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)</sup>。

这三种检验构成了文献中所称的假设检验“神圣三位一体”<sup>[4](https://arxiv.org/abs/2406.19956)</sup>。似然比检验需要同时拟合受约束和无约束模型，而瓦尔德检验和得分检验只需估计一个模型；三者渐近等价<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)</sup>。在有限样本中，它们可能给出不同的统计量值，对于线性模型，排序为瓦尔德 ≥ 似然比 ≥ 得分<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)</sup>。得分检验的一个实际优势在于，当候选变量数量很大时可用于遗漏变量筛选，因为只需拟合较小的模型<sup>[5](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)</sup>。更早的直觉性统计量，包括皮尔逊1900年拟合优度检验、莫兰1948年I检验和杜宾–沃森1950年检验，都可以给出得分检验的解释<sup>[4](https://arxiv.org/abs/2406.19956)</sup>。

## 计算中的应用：费雪得分法

得分驱动迭代最大化。牛顿–拉夫森更新使用观测海森矩阵；费雪得分法则用期望信息替代海森矩阵，给出形如 \( \beta^{(t+1)} = \beta^{(t)} + F(\beta^{(t)})^{-1} s(\beta^{(t)}) \) 的更新<sup>[10](https://web.stanford.edu/class/stats305b/notes/GLM_I.html)</sup><sup> • </sup><sup>[11](https://www.math.ntnu.no/emner/TMA4315/2017h/5GLM.html)</sup>。对于广义线性模型，该算法等价于迭代重加权最小二乘<sup>[10](https://web.stanford.edu/class/stats305b/notes/GLM_I.html)</sup>。

## 标准恒等式失效的情形

零均值性质和克拉美–罗界需要正则条件，特别是分布的支撑集不能依赖于参数。对于 \( \mathrm{Uniform}(0, \theta) \) 这样的族，对积分求导会产生边界项，得分不再具有零均值，通常的界和渐近理论不能直接适用<sup>[12](https://math.stackexchange.com/a/3087453/321264)</sup>。在模型误设下，得分的曲率和方差不再一致，最大似然估计的渐近协方差取三明治形式而非 \( I^{-1} \)<sup>[13](https://onlinelibrary.wiley.com/doi/abs/10.3982/ECTA9097)</sup>。

## 第二重含义：机器学习中的得分

在基于得分的生成建模中，“得分函数”指的是另一个对象：对数概率密度关于数据 \( x \)（而非参数 \( \theta \)）的梯度。这个斯坦得分是一个向量场，指向密度增长最快的方向<sup>[14](https://doi.org/10.1145/3626235)</sup>。赫尔辛基信息技术研究所和赫尔辛基大学的阿波·许韦里宁（Aapo Hyvärinen）于2005年证明，除归一化常数外密度已知的模型可以通过得分匹配来估计，即最小化模型对数密度梯度与数据对数密度梯度之间的期望平方距离，其目标函数化为模型对数密度导数的样本平均，且永远不需要难以处理的归一化常数<sup>[15](https://jmlr.csail.mit.edu/papers/volume6/hyvarinen05a/hyvarinen05a.pdf)</sup>。扩散模型建立在这一思想之上：它们用递增的高斯噪声扰动数据，训练一个以噪声为条件的网络来估计含噪分布的得分，并通过在递减的噪声水平上链接这些估计来生成样本<sup>[14](https://doi.org/10.1145/3626235)</sup>。

## References

1. [Larry Wasserman, "Fisher Information," 36-705 lecture notes, Carnegie Mellon University](https://www.stat.cmu.edu/~larry/%3Dstat705/Lecture13.pdf)
2. [Xiaodong Li, "Likelihood, score function, and Fisher information," lecture notes, UC Davis](https://www.stat.ucdavis.edu/~xdgli/Xiaodong_Li_Teaching_files/large_sample.pdf)
3. [R. A. Fisher (1922). "On the Mathematical Foundations of Theoretical Statistics," Philosophical Transactions of the Royal Society A 222, 309–368](https://errorstatistics.com/wp-content/uploads/2021/04/fisher-1922.pdf)
4. [Anil K. Bera and Yannis Bilias (2024). "Three Scores and 15 Years (1948–2023) of Rao's Score Test: A Brief History," arXiv:2406.19956](https://arxiv.org/abs/2406.19956)
5. [UCLA OARC Stats, "FAQ: How are the likelihood ratio, Wald, and Lagrange multiplier (score) tests different and/or similar?"](https://stats.oarc.ucla.edu/other/mult-pkg/faq/general/faqhow-are-the-likelihood-ratio-wald-and-lagrange-multiplier-score-tests-different-andor-similar/)
6. [Stat 135, "The Asymptotic Distribution of the MLE," UC Berkeley](https://stat135.berkeley.edu/spring-2026/lectures/lecture-14.html)
7. [D. M. McLiesh, appendix on likelihood and information, University of Waterloo](https://sas.uwaterloo.ca/~dlmcleis/book/appendixb.htm)
8. [C. R. Rao (1948). "Large sample tests of statistical hypotheses concerning several parameters with applications to problems of estimation," Mathematical Proceedings of the Cambridge Philosophical Society 44(1), 50–57](https://www.cambridge.org/core/journals/mathematical-proceedings-of-the-cambridge-philosophical-society/article/abs/large-sample-tests-of-statistical-hypotheses-concerning-several-parameters-with-applications-to-problems-of-estimation/B83FAA6838A7E7D933EA3582C784ED06)
9. [C. R. Rao (1948), full text scan](https://gwern.net/doc/statistics/1948-rao.pdf)
10. [STATS 305B, "Generalized linear models," Stanford University](https://web.stanford.edu/class/stats305b/notes/GLM_I.html)
11. [TMA4315 Generalized Linear Models, Norwegian University of Science and Technology](https://www.math.ntnu.no/emner/TMA4315/2017h/5GLM.html)
12. [Mathematics Stack Exchange, "Cramér–Rao Lower Bound when the support for x depends on θ?"](https://math.stackexchange.com/a/3087453/321264)
13. [Ulrich K. Müller (2013). "Risk of Bayesian Inference in Misspecified Models, and the Sandwich Covariance Matrix," Econometrica 81(5), 1805–1849](https://onlinelibrary.wiley.com/doi/abs/10.3982/ECTA9097)
14. ["Diffusion Models: A Comprehensive Survey of Methods and Applications," ACM Computing Surveys](https://doi.org/10.1145/3626235)
15. [Aapo Hyvärinen (2005). "Estimation of Non-Normalized Statistical Models by Score Matching," Journal of Machine Learning Research 6, 695–709](https://jmlr.csail.mit.edu/papers/volume6/hyvarinen05a/hyvarinen05a.pdf)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Statistical inference, estimation, sampling, and testing › Foundations of statistical inference › Asymptotic theory of statistics › Asymptotics of likelihood-based procedures

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/score-function

English original: https://www.edgepedia.org/score-function
