# Score (statistics)

Jump to navigation Jump to search

In statistics, the score (or informant) is the gradient of the log-likelihood function with respect to the parameter vector. Evaluated at a particular point, the score indicates the steepness of the log-likelihood function and thereby the sensitivity to infinitesimal changes to the parameter values. If the log-likelihood function is continuous over the parameter space, the score will vanish at a local maximum or minimum; this fact is used in maximum likelihood estimation to find the parameter values that maximize the likelihood function.

Since the score is a function of the observations that are subject to sampling error, it lends itself to a test statistic known as score test in which the parameter is held at a particular value. Further, the ratio of two likelihood functions evaluated at two distinct parameter values can be understood as a definite integral of the score function.[1]

## Definition

The score is the gradient (the vector of partial derivatives), with respect to some parameter ${\displaystyle \theta }$, of the logarithm (commonly the natural logarithm) of the likelihood function (the log-likelihood). If the observation is ${\displaystyle X}$ and its likelihood is ${\displaystyle {\mathcal {L}}(\theta ;X)}$, then the score ${\displaystyle s}$ can be found through the chain rule:

${\displaystyle s\equiv s(\theta ,X)={\frac {\partial }{\partial \theta }}\log {\mathcal {L}}(\theta ;X)={\frac {1}{{\mathcal {L}}(\theta ;X)}}{\frac {\partial {\mathcal {L}}(\theta ;X)}{\partial \theta }}.}$

Thus the score ${\displaystyle V}$ indicates the sensitivity of ${\displaystyle {\mathcal {L}}(\theta ;X)}$ (its derivative normalized by its value). Note that ${\displaystyle s}$ is a function of ${\displaystyle \theta }$ and the observation ${\displaystyle X}$, so that, in general, it is not a statistic. However, in certain applications, such as the score test, the score is evaluated at a specific value of ${\displaystyle \theta }$ (such as a null-hypothesis value, or at the maximum likelihood estimate of ${\displaystyle \theta }$), in which case the result is a statistic.

In older literature, the term "linear score" may be used to refer to the score with respect to infinitesimal translation of a given density. This convention arises from a time when the primary parameter of interest was the mean or median of a distribution. In this case, the likelihood of an observation is given by a density of the form ${\displaystyle {\mathcal {L}}(\theta ;X)=f(X+\theta )}$. The "linear score" is then defined as

${\displaystyle s_{\rm {linear}}={\frac {\partial }{\partial X}}\log f(X)}$

## Properties

### Mean

Under some regularity conditions, the expected value of ${\displaystyle s}$ with respect to the observation ${\displaystyle x}$, given the true parameter ${\displaystyle \theta }$, written ${\displaystyle \operatorname {E} (V\mid \theta )}$, is zero. To see this rewrite the likelihood function ${\displaystyle {\mathcal {L}}}$ as a probability density function ${\displaystyle {\mathcal {L}}(\theta ;x)=f(x;\theta )}$. Then:

{\displaystyle {\begin{aligned}\operatorname {E} (V\mid \theta )&=\int _{-\infty }^{+\infty }f(x;\theta ){\frac {\partial }{\partial \theta }}\log {\mathcal {L}}(\theta ;X)\,dx\\[6pt]&=\int _{-\infty }^{+\infty }f(x;\theta ){\frac {1}{f(x;\theta )}}{\frac {\partial f(x;\theta )}{\partial \theta }}\,dx=\int _{-\infty }^{+\infty }{\frac {\partial f(x;\theta )}{\partial \theta }}\,dx\end{aligned}}}

If certain differentiability conditions are met (see Leibniz integral rule), the integral may be rewritten as

${\displaystyle {\frac {\partial }{\partial \theta }}\int _{-\infty }^{+\infty }f(x;\theta )\,dx={\frac {\partial }{\partial \theta }}1=0.}$

It is worth restating the above result in words: the expected value of the score is zero. Thus, if one were to repeatedly sample from some distribution, and repeatedly calculate the score, then the mean value of the scores would tend to zero as the number of repeat samples approached infinity.

### Variance

The variance of the score is known as the Fisher information and is written ${\displaystyle {\mathcal {I}}(\theta )}$. Because the expectation of the score is zero, this may be written as

${\displaystyle {\mathcal {I}}(\theta )=\operatorname {E} \left\{\left.\left[{\frac {\partial }{\partial \theta }}\log {\mathcal {L}}(\theta ;X)\right]^{2}\right|\theta \right\}.}$

Note that the Fisher information, as defined above, is not a function of any particular observation, as the random variable ${\displaystyle X}$ has been averaged out. This concept of information is useful when comparing two methods of observation of some random process.

## Examples

### Bernoulli process

Consider observing the first n trials of a Bernoulli process, and seeing that A of them are successes and the remaining B are failures, where the probability of success is θ.

Then the likelihood ${\displaystyle {\mathcal {L}}}$ is

${\displaystyle {\mathcal {L}}(\theta ;A,B)={\frac {(A+B)!}{A!B!}}\theta ^{A}(1-\theta )^{B},}$

so the score s is

${\displaystyle s={\frac {1}{\mathcal {L}}}{\frac {\partial {\mathcal {L}}}{\partial \theta }}={\frac {A}{\theta }}-{\frac {B}{1-\theta }}.}$

We can now verify that the expectation of the score is zero. Noting that the expectation of A is and the expectation of B is n(1 − θ) [recall that A and B are random variables], we can see that the expectation of s is

${\displaystyle E(s)={\frac {n\theta }{\theta }}-{\frac {n(1-\theta )}{1-\theta }}=n-n=0.}$

We can also check the variance of ${\displaystyle s}$. We know that A + B = n (so Bn − A) and the variance of A is (1 − θ) so the variance of s is

{\displaystyle {\begin{aligned}\operatorname {var} (s)&=\operatorname {var} \left({\frac {A}{\theta }}-{\frac {n-A}{1-\theta }}\right)=\operatorname {var} \left(A\left({\frac {1}{\theta }}+{\frac {1}{1-\theta }}\right)\right)\\&=\left({\frac {1}{\theta }}+{\frac {1}{1-\theta }}\right)^{2}\operatorname {var} (A)={\frac {n}{\theta (1-\theta )}}.\end{aligned}}}

### Binary outcome model

For models with binary outcomes (Y = 1 or 0), the model can be scored with the logarithm of predictions

${\displaystyle S=Y\log(p)+(1-Y)(\log(1-p))}$

where p is the probability in the model to be estimated and S is the score.[2]

## Applications

### Scoring algorithm

The scoring algorithm is an iterative method for numerically determining the maximum likelihood estimator.

## Notes

1. ^ Pickles, Andrew (1985). An Introduction to Likelihood Analysis. Norwich: W. H. Hutchins & Sons. pp. 24–29. ISBN 0-86094-190-6.
2. ^ Steyerberg, E. W.; Vickers, A. J.; Cook, N. R.; Gerds, T.; Gonen, M.; Obuchowski, N.; Pencina, M. J.; Kattan, M. W. (2010). "Assessing the performance of prediction models. A framework for traditional and novel measures". Epidemiology. 21 (1): 128–138. doi:10.1097/EDE.0b013e3181c30fb2. PMC 3575184.