Integer type:** int32**** int64**** nag_int** show int32 show int32 show int64 show int64 show nag_int show nag_int

G07 — Univariate Estimation

This chapter deals with the estimation of unknown parameters of a univariate distribution. It includes both point and interval estimation using maximum likelihood and robust methods.

Statistical inference is concerned with the making of inferences about a **population** using the observed part of the population called a **sample**. The population can usually be described using a probability model which will be written in terms of some unknown **parameters**. For example, the hours of relief given by a drug may be assumed to follow a Normal distribution with mean μ$\mu $ and variance σ^{2}${\sigma}^{2}$; it is then required to make inferences about the parameters, μ$\mu $ and σ^{2}${\sigma}^{2}$, on the basis of an observed sample of relief times.

There are two main aspects of statistical inference: the **estimation** of the parameters and the **testing of hypotheses** about the parameters. In the example above, the values of the parameter σ^{2}${\sigma}^{2}$ may be estimated and the hypothesis that μ ≥ 3$\mu \ge 3$ tested. This chapter is mainly concerned with estimation but the test of a hypothesis about a parameter is often closely linked to its estimation. Tests of hypotheses which are not linked closely to estimation are given in the chapter on nonparametric statistics (Chapter G08).

There are two types of estimation to be considered in this chapter: **point estimation** and **interval estimation**. Point estimation is when a single value is obtained as the best estimate of the parameter. However, as this estimate will be based on only one of a large number of possible samples, it can be seen that if a different sample were taken, a different estimate would be obtained. The distribution of the estimate across all the possible samples is known as the **sampling distribution**. The sampling distribution contains information on the performance of the estimator, and enables estimators to be compared. For example, a good estimator would have a sampling distribution with mean equal to the true value of the parameter; that is, it should be an **unbiased** estimator; also the variance of the sampling distribution should be as small as possible. When considering a parameter estimate it is important to consider its variability as measured by its variance, or more often the square root of the variance, the **standard error**.

The sampling distribution can be used to find interval estimates or confidence intervals for the parameter. A **confidence interval** is an interval calculated from the sample so that its distribution, as given by the sampling distribution, is such that it contains the true value of the parameter with a certain probability.

Estimates will be functions of the observed sample and these functions are known as **estimators**. It is usually more convenient for the estimator to be based on statistics from the sample rather than all the individuals observations. If these statistics contain all the relevant information then they are known as **sufficient statistics**. There are several ways of obtaining the estimators; these include least squares, the method of moments, and **maximum likelihood**. Least squares estimation requires no knowledge of the distributional form of the error apart from its mean and variance matrix, whereas the method of maximum likelihood is mainly applicable to situations in which the true distribution is known apart from the values of a finite number of unknown parameters. Note that under the assumption of Normality, the least squares estimation is equivalent to the maximum likelihood estimation. Least squares is often used in regression analysis as described in Chapter G02, and maximum likelihood is described below.

Estimators derived from least squares or maximum likelihood will often be greatly affected by the presence of extreme or unusual observations. Estimators that are designed to be less affected are known as **robust estimators**.

Let X_{i}${X}_{i}$ be a univariate random variable with probability density function

where θ$\theta $ is a vector of length p$p$ consisting of the unknown parameters. For example, a Normal distribution with mean θ_{1}${\theta}_{1}$ and standard deviation θ_{2}${\theta}_{2}$ has probability density function

The likelihood for a sample of n$n$ independent observations is

where x_{i}${x}_{i}$ is the observed value of X_{i}${X}_{i}$. If each X_{i}${X}_{i}$ has an identical distribution, this reduces to

and the log-likelihood is

The maximum likelihood estimates (θ̂$\hat{\theta}$) of θ$\theta $ are the values of θ$\theta $ that maximize (1) and (2). If the range of X$X$ is independent of the parameters, then θ̂$\hat{\theta}$ can usually be found as the solution to

Note that
( ∂ L)/( ∂ θ_{j})
$\frac{\partial L}{\partial {\theta}_{j}}$ is known as the efficient score.

f _{Xi}(x_{i} ; θ),
$${f}_{{X}_{i}}({x}_{i};\theta )\text{,}$$ |

1/(sqrt(2π)θ _{2})exp( − (1/2)((x_{i} − θ_{1})/(θ_{2}))^{2})
.
$$\frac{1}{\sqrt{2\pi}{\theta}_{2}}\mathrm{exp}(-\frac{1}{2}{\left(\frac{{x}_{i}-{\theta}_{1}}{{\theta}_{2}}\right)}^{2})\text{.}$$ |

$$\mathrm{Like}=\prod _{i=1}^{n}{f}_{{X}_{i}}({x}_{i};\theta )\text{,}$$ |

$$\mathrm{Like}=\prod _{i=1}^{n}{f}_{X}({x}_{i};\theta )\text{,}$$ | (1) |

$$\mathrm{log}\left(\mathrm{Like}\right)=L=\sum _{i=1}^{n}\mathrm{log}\left({f}_{X}({x}_{i};\theta )\right)\text{.}$$ | (2) |

$$\sum _{i=1}^{n}\frac{\partial}{\partial {\hat{\theta}}_{j}}\mathrm{log}\left({f}_{X}({x}_{i};\hat{\theta})\right)=\frac{\partial L}{\partial {\hat{\theta}}_{j}}=0\text{, \hspace{1em}}j=1,2,\dots ,p\text{.}$$ | (3) |

Maximum likelihood estimators possess several important properties.

(a) | Maximum likelihood estimators are functions of the sufficient statistics. | ||||

(b) | Maximum likelihood estimators are (under certain conditions) consistent. That is, the estimator converges in probability to the true value as the sample size increases. Note that for small samples the maximum likelihood estimator may be biased. |
||||

(c) | For maximum likelihood estimators found as a solution to (3), subject to certain conditions, it follows that
_{0}${\theta}_{0}$ and variance-covariance matrix I_{θ0}^{ − 1}${I}_{{\theta}_{0}}^{-1}$ where θ_{0}${\theta}_{0}$ denotes the true value of θ$\theta $. The matrix I_{θ}${I}_{\theta}$ is known as the information matrix and I_{θ0}^{ − 1}${I}_{{\theta}_{0}}^{-1}$ is known as the Cramer–Rao lower bound for the variance of an estimator of θ$\theta $. |

For example, if we consider a sample, x_{1},x_{2}, … ,x_{n}${x}_{1},{x}_{2},\dots ,{x}_{n}$, of size n$n$ drawn from a Normal distribution with unknown mean μ$\mu $ and unknown variance σ_{2}${\sigma}_{2}$ then we have

and thus

and

Then equating these two equations to zero and solving gives the maximum likelihood estimates

and

These maximum likelihood estimates are asymptotically Normal with mean vector a$a$, where

and covariance matrix C$C$. To obtain C$C$ we find the second derivatives of L$L$ with respect to μ$\mu $ and σ^{2}${\sigma}^{2}$ as follows:

Then

so that

To obtain an estimate of C$C$ the matrix may be evaluated at the maximum likelihood estimates.

$$L=\mathrm{log}\left(\mathrm{Like}(\mu ,{\sigma}^{2};x)\right)=-\frac{n}{2}\mathrm{log}\left(2\pi \right)-\frac{n}{2}\mathrm{log}\left({\sigma}^{2}\right)-\sum _{i=1}^{n}{({x}_{i}-\mu )}^{2}/2{\sigma}^{2}$$ |

$$\frac{\partial L}{\partial \mu}=\sum _{i=1}^{n}({x}_{i}-\mu )/{\sigma}^{2}$$ |

$$\frac{\partial L}{\partial {\sigma}^{2}}=-\frac{n}{2{\sigma}^{2}}+\sum _{i=1}^{n}{({x}_{i}-\mu )}^{2}/2{\sigma}^{4}\text{.}$$ |

μ̂ = x
$$\hat{\mu}=\stackrel{-}{x}$$ |

$${\hat{\sigma}}^{2}=\sum _{i=1}^{n}{({x}_{i}-\stackrel{-}{x})}^{2}/n\text{.}$$ |

a ^{T} = (μ,σ^{2}),
$${a}^{\mathrm{T}}=(\mu ,{\sigma}^{2})\text{,}$$ |

$$\begin{array}{c}\frac{{\partial}^{2}L}{\partial {\mu}^{2}}=-\frac{n}{{\sigma}^{2}}\\ \frac{{\partial}^{2}L}{\partial {\left({\sigma}^{2}\right)}^{2}}=\frac{n}{2{\sigma}^{4}}-\sum _{i=1}^{n}{({x}_{i}-\mu )}^{2}/{\sigma}^{6}\\ \frac{{\partial}^{2}L}{\partial \mu \partial {\sigma}^{2}}=\frac{{\partial}^{2}L}{\partial {\sigma}^{2}\partial \mu}=-\frac{n(\stackrel{-}{x}-\mu )}{{\sigma}^{4}}\text{.}\end{array}$$ |

C ^{ − 1} = − E
$${C}^{-1}=-E\left(\begin{array}{cc}\frac{{\partial}^{2}L}{\partial {\mu}^{2}}& \frac{{\partial}^{2}L}{\partial {\sigma}^{2}\partial \mu}\\ \frac{{\partial}^{2}L}{\partial \mu \partial {\sigma}^{2}}& \frac{{\partial}^{2}L}{\partial {\left({\sigma}^{2}\right)}^{2}}\end{array}\right)=\left(\begin{array}{cc}n/{\sigma}^{2}& 0\\ 0& n/2{\sigma}^{4}\end{array}\right)$$ |

C =
$$C=\left(\begin{array}{cc}{\sigma}^{2}/n& 0\\ 0& 2{\sigma}^{4}/n\end{array}\right)\text{.}$$ |

It may not always be possible to find maximum likelihood estimates in a convenient closed form, and in these cases iterative numerical methods, such as the Newton–Raphson procedure or the EM algorithm (expectation maximization), will be necessary to compute the maximum likelihood estimates. Their asymptotic variances and covariances may then be found by substituting the estimates into the second derivatives. Note that it may be difficult to find the expected value of the second derivatives required for the variance-covariance matrix and in these cases the observed value of the second derivatives is often used.

The use of maximum likelihood estimation allows the construction of generalized likelihood ratio tests. If λ = 2(l_{1} − l_{2})$\lambda =2({l}_{1}-{l}_{2})$, where l_{1}${l}_{1}$ is the maximized log-likelihood function for a model 1$1$ and l_{2}${l}_{2}$ is the maximized log-likelihood function for a model 2$2$, then under the hypothesis that model 2$2$ is correct, 2λ$2\lambda $ is asymptotically distributed as a χ^{2}${\chi}^{2}$ variable with p − q$p-q$ degrees of freedom. Consider two models in which model 1$1$ has p$p$ parameters and model 2$2$ is a sub-model (nested model) of model 1$1$ with q < p$q<p$ parameters, that is model 1$1$ has an extra p − q$p-q$ parameters. This result provides a useful method for performing hypothesis tests on the parameters. Alternatively, tests exist based on the asymptotic Normality of the estimator and the efficient score; see page 315 of Cox and Hinkley (1974).

Suppose we can find a function, t(x,θ)$t(x,\theta )$, whose distribution depends upon the sample x$x$ but not on the unknown parameter θ$\theta $, and which is a monotonic (say decreasing) function in θ$\theta $ for each x$x$, then we can find t_{1}${t}_{1}$ such that
P
(t_{1} ≤ t(x,θ))
=
1
−
α
$P({t}_{1}\le t(x,\theta ))=1-\alpha $ no matter what θ$\theta $ happens to be. The function t(x,θ)$t(x,\theta )$ is known as a pivotal quantity. Since the function is monotonic the statement that t_{1} ≤ t(x,θ)${t}_{1}\le t(x,\theta )$ may be rewritten as θ ≥ θ_{1}(x)$\theta \ge {\theta}_{1}\left(x\right)$ see Figure 1. The statistic θ_{1}(x)${\theta}_{1}\left(x\right)$ will vary from sample to sample and if we assert that θ ≥ θ_{1}(x)$\theta \ge {\theta}_{1}\left(x\right)$ for any sample values which arise, we will be right in a proportion 1 − α$1-\alpha $ of the cases, in the long run or on average. We call θ_{1}(x)${\theta}_{1}\left(x\right)$ a 1 − α$1-\alpha $ upper confidence limit for θ$\theta $.

Hypothesis (significance) tests on the parameters may be used to find these confidence limits. For example, if we observe a value, k$k$, from a binomial distribution, with known parameter n$n$ and unknown parameter p$p$, then to find the lower confidence limit we find p_{l}${p}_{l}$ such that the probability that the null hypothesis H_{0}${H}_{0}$: p = p_{l}$p={p}_{l}$ (against the one sided alternative that p > p_{l}$p>{p}_{l}$) will be rejected, is less than or equal to α / 2$\alpha /2$. Thus for a binomial random variable, B$B$, with parameters n$n$ and p_{l}${p}_{l}$ we require that P(B ≥ k) ≤ α / 2$P(B\ge k)\le \alpha /2$. The upper confidence limit, p_{u}${p}_{u}$, can be constructed in a similar way.

For large samples the asymptotic Normality of the maximum likelihood estimates discussed above is used to construct confidence intervals for the unknown parameters.

For particular cases the probability density function can be written as

for a suitable function g$g$; then θ_{1}${\theta}_{1}$ is known as a location parameter and θ_{2}${\theta}_{2}$, usually written as σ$\sigma $, is known as a scale parameter. This is true of the Normal distribution.

f _{Xi}(x_{i} ; θ) = 1/(θ_{2})g
((x_{i} − θ_{1})/(θ_{2}))
$${f}_{{X}_{i}}({x}_{i};\theta )=\frac{1}{{\theta}_{2}}g\left(\frac{{x}_{i}-{\theta}_{1}}{{\theta}_{2}}\right)$$ |

If θ_{1}${\theta}_{1}$ is a location parameter, as described above, then equation (3) becomes

where ψ(z) = − d/(dz)log(g(z))$\psi \left(z\right)=-\frac{d}{dz}\mathrm{log}\left(g\left(z\right)\right)$.

$$\sum _{i=1}^{n}\psi \left(\frac{{x}_{i}-{\hat{\theta}}_{1}}{\hat{\sigma}}\right)=0\text{,}$$ | (6) |

For the scale parameter σ$\sigma $ (or σ^{2}${\sigma}^{2}$) the equation is

where χ(z) = zψ(z) / 2$\chi \left(z\right)=z\psi \left(z\right)/2$.

$$\sum _{i=1}^{n}\chi \left(\frac{{x}_{i}-{\hat{\theta}}_{1}}{\hat{\sigma}}\right)=n/2\text{,}$$ | (7) |

For the Normal distribution ψ(z) = z$\psi \left(z\right)=z$ and χ(z) = z^{2} / 2$\chi \left(z\right)={z}^{2}/2$. Thus, the maximum likelihood estimates for θ_{1}${\theta}_{1}$ and σ^{2}${\sigma}^{2}$ are the sample mean and variance with the n$n$ divisor respectively. As the latter is biased, (7) can be replaced by

where β$\beta $ is a suitable constant, which for the Normal χ$\chi $ function is (1/2)
$\frac{1}{2}$.

$$\sum _{i=1}^{n}\chi \left(\frac{{x}_{i}-{\hat{\theta}}_{1}}{\hat{\sigma}}\right)=(n-1)\beta \text{,}$$ | (8) |

The influence of an observation on the estimates depends on the form of the ψ$\psi $ and χ$\chi $ functions. For a discussion of influence, see Hampel et al. (1986) and Huber (1981). The influence of extreme values can be reduced by bounding the values of the ψ$\psi $- and χ$\chi $-functions. One suggestion due to Huber (1981) is

**Figure 2**
Redescending ψ$\psi $-functions are often considered; these give zero values to ψ(z)$\psi \left(z\right)$ for large positive or negative values of z$z$. Hampel et al. (1986) suggested

**Figure 3**
Usually a χ$\chi $-function based on Huber's ψ$\psi $-function is used: χ = ψ^{2} / 2$\chi ={\psi}^{2}/2$. Estimators based on such bounded ψ$\psi $-functions are known as M$M$-estimators, and provide one type of robust estimator.

ψ(z) =
$$\psi \left(z\right)=\{\begin{array}{rl}-C\text{,}& \phantom{\left|\right|}z<-C\\ z\text{,}& \left|z\right|\le C\\ C\text{,}& \phantom{\left|\right|}z>C\text{.}\end{array}$$ |

ψ(z) =
$$\psi \left(z\right)=\{\begin{array}{cr}-\psi (-z)& \\ z\text{,}& 0\le z\le {h}_{1}\phantom{\text{.}}\\ {h}_{1}\text{,}& {h}_{1}\le z\le {h}_{2}\phantom{\text{.}}\\ {h}_{1}({h}_{3}-z)/({h}_{3}-{h}_{2})\text{,}& {h}_{2}\le z\le {h}_{3}\phantom{\text{.}}\\ 0\text{,}& z>{h}_{3}\text{.}\end{array}$$ |

Other robust estimators for the location parameter are

(i) | the sample median, |

(ii) | the trimmed mean, i.e., the mean calculated after the extreme values have been removed from the sample, |

(iii) | the winsorized mean, i.e., the mean calculated after the extreme values of the sample have been replaced by other more moderate values from the sample. |

For the scale parameter, alternative estimators are

(i) | the median absolute deviation scaled to produce an estimator which is unbiased in the case of data coming from a Normal distribution, |

(ii) | the winsorized variance, i.e., the variance calculated after the extreme values of the sample have been replaced by other more moderate values from the sample. |

For a general discussion of robust estimation, see Hampel et al. (1986) and Huber (1981).

In Section [Confidence Intervals] it was shown how tests of hypotheses can be used to find confidence intervals. That approach uses a parametric test that requires the assumption that the data used in the computation of the confidence has a known distribution. As an alternative, a more robust confidence interval can be found by replacing the parametric test by a nonparametric test. In the case of the confidence interval for the location parameter, a Wilcoxon test statistic can be used, and for the difference in location, computed from two samples, a Mann–Whitney test statistic can be used.

nag_univar_ci_binomial (g07aa) | provides a confidence interval for the parameter p$p$ of the binomial distribution. |

nag_univar_ci_poisson (g07ab) | provides a confidence interval for the mean parameter of the Poisson distribution. |

nag_univar_estim_normal (g07bb) | provides maximum likelihood estimates and their standard errors for the parameters of the Normal distribution from grouped and/or censored data. |

nag_univar_estim_weibull (g07be) | provides maximum likelihood estimates and their standard errors for the parameters of the Weibull distribution from data which may be right-censored. |

nag_univar_estim_genpareto (g07bf) | provides maximum likelihood estimates and their standard errors for the parameters of the generalized Pareto distribution. |

nag_univar_ttest_2normal (g07ca) | provides a t$t$-test statistic to test for a difference in means between two Normal populations, together with a confidence interval for the difference between the means. |

nag_univar_robust_1var_mestim (g07db) | provides M$M$-estimates for location and, optionally, scale using four common forms of the ψ$\psi $-function. |

nag_univar_robust_1var_mestim_wgt (g07dc) | produces the M$M$-estimates for location and, optionally, scale but for user-supplied ψ$\psi $- and χ$\chi $-functions. |

nag_univar_robust_1var_median (g07da) | provides the sample median, median absolute deviation, and the scaled value of the median absolute deviation. |

nag_univar_robust_1var_trimmed (g07dd) | provides the trimmed mean and winsorized mean together with estimates of their variance based on a winsorized variance. |

nag_univar_robust_1var_ci (g07ea) | produces a rank based confidence interval for locations. |

nag_univar_robust_2var_ci (g07eb) | produces a rank based confidence interval for the difference in location between two populations. |

This chapter provides two functions for identifying potential outlying values, nag_univar_outlier_peirce_1var (g07ga) and nag_univar_outlier_peirce_2var (g07gb). Many of the model fitting functions, for examples those in Chapters G02 and G13 also return vectors of residuals which can also be used to aid in the identification of outlying values.

t-test |

M-estimates for location and scale parameters, |

Cox D R and Hinkley D V (1974) *Theoretical Statistics* Chapman and Hall

Hampel F R, Ronchetti E M, Rousseeuw P J and Stahel W A (1986) *Robust Statistics. The Approach Based on Influence Functions* Wiley

Huber P J (1981) *Robust Statistics* Wiley

Kendall M G and Stuart A (1973) *The Advanced Theory of Statistics (Volume 2)* (3rd Edition) Griffin

Silvey S D (1975) *Statistical Inference* Chapman and Hall

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013