Search

Search papers and lessons

Profile Likelihood

Level 4 · 10 min read

The profile likelihood keeps the parameter you care about, removes the nuisance parameters by maximising over them, and then reads off intervals and tests from the result.

On this page

  • Colour = topic mix
  • Discrete math
  • Probability
  • Calculus
  • Inference
  • Sign in to see your progress

TL;DR

A model often has two kinds of unknowns: the quantity you want to report, and the nuisance parameters the model needs but you do not care about. The profile likelihood fixes the quantity you want, and for each value of it takes the best possible setting of the nuisance parameters. What remains is a likelihood for the quantity of interest alone, which you can use for confidence intervals and tests as if it had been the only unknown.

Where you'll see it: in the confidence intervals that statistical software reports for a single effect in a model with many other unknowns, and in particle physics, where a signal strength is tested while background rates are nuisance parameters.

Intuition

Suppose you measure a quantity and also need to estimate its noise level. You want an interval for the quantity, but the noise level is in the way. Two bad options come to mind. You could pretend the noise level is known, which makes your interval too narrow. Or you could ignore the noise level altogether, which is not even a valid model.

The profile likelihood takes a middle path. Think of the full likelihood as a landscape over two axes: the quantity ψ\psi you care about, and the nuisance λ\lambda. For each fixed ψ\psi, walk along λ\lambda and find the highest point in that direction. Record that height. Doing this for every ψ\psi traces a ridge over the landscape, and the ridge is the profile. Its shape tells you how strongly the data favour each value of ψ\psi, with the nuisance parameter already set as well as the data allow.

The plot below uses the example worked out later in this lesson. The curve shows how far each value of the mean falls below its best value once the variance is set as well as the data allow. The dashed line is the cutoff for a 95 percent interval.

−2−101234560123456mu (mean)ratio statistic
  • profile ratio for the mean
  • 95% cutoff (3.84)
Values of the mean inside the dashed line are not rejected at the 95 percent level. The point at the bottom is the maximum likelihood estimate.

The math

Write the model's parameters as a pair (ψ,λ)(\psi, \lambda). Here ψ\psi is the parameter of interest, a vector or a single number, and λ\lambda collects the nuisance parameters. Let ℓ(ψ,λ)\ell(\psi, \lambda) be the log-likelihood of the observed data, the Logarithm of the likelihood.

Definition: Profile log-likelihood

For each fixed value of ψ\psi, let λ^ψ\hat{\lambda}_\psi be the value of λ\lambda that maximises ℓ(ψ,λ)\ell(\psi, \lambda). The profile log-likelihood is

ℓp(ψ)=max⁡λ ℓ(ψ,λ)=ℓ(ψ,λ^ψ).\ell_p(\psi) = \max_{\lambda}\, \ell(\psi, \lambda) = \ell\big(\psi, \hat{\lambda}_\psi\big).

Let (ψ^,λ^)(\hat{\psi}, \hat{\lambda}) be the overall maximum likelihood estimate. The profile likelihood ratio statistic is

Λ(ψ)=2[ℓ(ψ^,λ^)−ℓp(ψ)]≥0.\Lambda(\psi) = 2\left[\ell(\hat{\psi}, \hat{\lambda}) - \ell_p(\psi)\right] \ge 0 .

It is zero at the estimate and grows as ψ\psi moves away from it.

Read the definition in words. For each candidate ψ\psi, you pretend it is the truth and refit the nuisance parameters to that pretence. The profile is the best fit you get for that ψ\psi. The statistic Λ\Lambda measures how much worse that best fit is than the overall best fit, in units that will turn out to have a known distribution.

Using the statistic

Wilks' theorem says that under regularity conditions and for a true value of ψ\psi, Λ(ψ)\Lambda(\psi) is approximately chi-squared distributed. The degrees of freedom equal the number of components of ψ\psi being tested. For a single parameter of interest the reference distribution is χ12\chi^2_1, whose 95th percentile is 3.8413.841.

So an approximate 95 percent confidence set for ψ\psi is

{ψ:Λ(ψ)≤3.841}.\left\{\psi : \Lambda(\psi) \le 3.841 \right\}.

For one parameter, this set is usually an interval, and you read its endpoints off the profile.

Why it works with a nuisance parameter

Consider a Gaussian with unknown mean μ\mu, the parameter of interest, and unknown variance σ2\sigma^2, the nuisance parameter. For nn observations with sample mean xˉ\bar{x} and total squared deviation SSmin⁡=∑i(xi−xˉ)2SS_{\min} = \sum_i (x_i - \bar{x})^2, the sum of squares for a candidate mean is

SS(μ)=∑i(xi−μ)2=SSmin⁡+n(μ−xˉ)2.SS(\mu) = \sum_i (x_i - \mu)^2 = SS_{\min} + n(\mu - \bar{x})^2 .

For a fixed μ\mu, the variance that maximises the likelihood is σ^μ2=SS(μ)/n\hat{\sigma}^2_\mu = SS(\mu)/n. Substituting it back gives a profile that depends on μ\mu only through SS(μ)SS(\mu). This closed form is what makes the Gaussian a good teaching case, and it leads to

Λ(μ)=nlog⁡ ⁣(1+n(μ−xˉ)2SSmin⁡).\Lambda(\mu) = n \log\!\left(1 + \frac{n(\mu - \bar{x})^2}{SS_{\min}}\right).

The nuisance variance has disappeared from the formula, and only the mean remains. That is the point of profiling.

Worked examples

Example
1. Two observations, step by step

Take the data x=(1,3)x = (1, 3), from a Gaussian with unknown mean μ\mu and variance σ2\sigma^2. Here n=2n = 2.

  1. The sample mean is xˉ=2\bar{x} = 2, so the MLE of the mean is μ^=2\hat{\mu} = 2.
  2. The sum of squares about xˉ\bar{x} is SSmin⁡=(1−2)2+(3−2)2=2SS_{\min} = (1-2)^2 + (3-2)^2 = 2.
  3. Apply the formula with n=2n = 2: Λ(μ)=2log⁡ ⁣(1+2(μ−2)22)=2log⁡ ⁣(1+(μ−2)2)\Lambda(\mu) = 2\log\!\left(1 + \dfrac{2(\mu - 2)^2}{2}\right) = 2\log\!\left(1 + (\mu - 2)^2\right).
  4. At μ=2\mu = 2 the statistic is 2log⁡1=02\log 1 = 0, as it should be.
  5. At μ=3\mu = 3 it is 2log⁡2≈1.392\log 2 \approx 1.39, below 3.843.84, so μ=3\mu = 3 is inside the set.
  6. Solve 2log⁡(1+d2)=3.8412\log(1 + d^2) = 3.841 for d=∣μ−2∣d = |\mu - 2|: 1+d2=e1.9205≈6.821 + d^2 = e^{1.9205} \approx 6.82, so d≈2.41d \approx 2.41.
  7. The approximate 95 percent set is μ∈[−0.41, 4.41]\mu \in [-0.41,\ 4.41].

The interpretation is that the two observations are compatible with a mean anywhere from about −0.4-0.4 to 4.44.4. This interval is a poor approximation, because n=2n = 2 is far too small for Wilks' theorem to be accurate. The exact tt-based interval, which uses the sample variance s2=2s^2 = 2 and t0.975,1≈12.71t_{0.975, 1} \approx 12.71, is 2±12.712 \pm 12.71, about [−10.7, 14.7][-10.7,\ 14.7]. Profiling is not a substitute for enough data, and this example shows the gap clearly.

Example
2. The textbook case: ten observations

Suppose n=10n = 10, xˉ=5\bar{x} = 5, and SSmin⁡=18SS_{\min} = 18, so the unbiased sample variance is s2=18/9=2s^2 = 18/9 = 2.

  1. Use the formula: Λ(μ)=10log⁡ ⁣(1+10(μ−5)218)\Lambda(\mu) = 10\log\!\left(1 + \dfrac{10(\mu - 5)^2}{18}\right).
  2. Set Λ(μ)=3.841\Lambda(\mu) = 3.841. Then log⁡(⋅)=0.3841\log(\cdot) = 0.3841, so the bracket equals e0.3841≈1.4683e^{0.3841} \approx 1.4683.
  3. Then 10d218=0.4683\dfrac{10 d^2}{18} = 0.4683, which gives d2≈0.8429d^2 \approx 0.8429 and d≈0.918d \approx 0.918.
  4. The profile interval is 5±0.9185 \pm 0.918, that is [4.08, 5.92][4.08,\ 5.92].
  5. For comparison, the exact tt interval uses s/n=0.447s/\sqrt{n} = 0.447 and t0.975,9≈2.262t_{0.975, 9} \approx 2.262, giving 5±1.0125 \pm 1.012.

The profile interval is shorter than the exact one. This is a known feature of the approximation. The profile uses σ^2=SS/n\hat{\sigma}^2 = SS/n, which divides by nn rather than n−1n - 1, and it treats the variance as if it were known once fitted. At ten observations the difference is visible, and it shrinks as nn grows.

Example
3. A realistic sample of twenty-five

A lab records n=25n = 25 measurements of a concentration. The sample mean is xˉ=12.4\bar{x} = 12.4 and the unbiased sample variance is s2=4.0s^2 = 4.0, so SSmin⁡=24×4.0=96SS_{\min} = 24 \times 4.0 = 96.

  1. Set Λ(μ)=25log⁡ ⁣(1+25(μ−12.4)296)=3.841\Lambda(\mu) = 25\log\!\left(1 + \dfrac{25(\mu - 12.4)^2}{96}\right) = 3.841.
  2. Then log⁡(⋅)=3.841/25=0.15364\log(\cdot) = 3.841 / 25 = 0.15364, so the bracket equals e0.15364≈1.16607e^{0.15364} \approx 1.16607.
  3. Then 25d296=0.16607\dfrac{25 d^2}{96} = 0.16607, which gives d2≈0.6377d^2 \approx 0.6377 and d≈0.799d \approx 0.799.
  4. The profile interval is 12.4±0.8012.4 \pm 0.80, that is [11.60, 13.20][11.60,\ 13.20].
  5. The exact tt interval uses s/n=0.4s/\sqrt{n} = 0.4 and t0.975,24≈2.064t_{0.975, 24} \approx 2.064, giving 12.4±0.8312.4 \pm 0.83.

The two intervals agree to within a few hundredths. At this sample size the approximation is good, and the lab can report either. The profile method has the advantage that it generalises to models where no closed form for the interval exists, which is the usual situation when the nuisance parameters are many or the model is not Gaussian.

Tradeoffs and failure modes

SituationWhat goes wrongBetter choice
Small sampleWilks' theorem is inaccurate, and intervals can be too short or too long.Simulate the distribution of Λ\Lambda, or use an exact method where one exists.
Many nuisance parameters, especially ones that grow with nnThe maximised nuisance values can be biased, and the profile can mislead.Use conditional or marginal likelihood, or a Bayesian integration over λ\lambda.
Parameter at a boundary, such as a variance at zeroThe χ2\chi^2 reference is wrong; the correct mixture distribution is needed.Use the boundary-adjusted reference distribution.
Likelihood with several flat ridgesThe profile can have multiple maxima, and the maximisation over λ\lambda may find a local one.Restart the optimiser from several starting points and check the profile curve.

Profiling ignores the uncertainty in the nuisance parameters, which is why it can be too narrow in small samples. Marginal likelihood, which averages instead of maximises over λ\lambda, is the usual remedy when that matters.

History

The likelihood ideas behind this lesson go back to Ronald Fisher's work in the 1920s, which introduced maximum likelihood as a general estimation method and studied the role of nuisance parameters. Samuel Wilks published his result on the large-sample distribution of the likelihood ratio in 1938, which gave the χ2\chi^2 reference used here. Jerzy Neyman and Elizabeth Scott's 1948 paper showed that maximum likelihood can give inconsistent estimates when the number of nuisance parameters grows with the sample, which is the reason for the caution in the tradeoffs table.

Recap

A nuisance parameter is needed to fit a model but is not the thing you want to report. The profile likelihood maximises over the nuisance parameters for each value of the parameter of interest, giving a one-dimensional likelihood. Wilks' theorem turns the profile into an approximate χ2\chi^2 statistic, which gives intervals and tests. The method is accurate for large samples and needs care when samples are small or nuisance parameters are many. The next step is the likelihood ratio test, which uses the same statistic to compare two models.

Check yourself

QuestionIn one sentence, what does the profile likelihood do with the nuisance parameters?Show answer

It maximises the likelihood over the nuisance parameters separately for each fixed value of the parameter of interest, leaving a likelihood that depends only on the parameter of interest.

QuestionFor the data x = (1, 3), the profile ratio for the mean is Lambda(mu) = 2 log(1 + (mu - 2)^2). Compute Lambda at mu = 0 and state whether mu = 0 lies in the approximate 95 percent set.Show answer

At μ=0\mu = 0, (μ−2)2=4(\mu - 2)^2 = 4, so Λ=2log⁡5≈3.22\Lambda = 2\log 5 \approx 3.22. This is below 3.8413.841, so μ=0\mu = 0 lies inside the approximate 95 percent set. The set runs from about −0.41-0.41 to 4.414.41, which contains 00.

QuestionWhy does the profile interval for the mean with n = 10 come out shorter than the exact t interval?Show answer

The profile fixes the variance at its maximum likelihood value, SS/nSS/n, and then applies a chi-squared reference. That ignores the extra uncertainty in estimating the variance, and it uses the approximation of Wilks' theorem, which is loose at small nn. The exact tt interval accounts for the estimated variance through the heavier tails of the tt distribution.

QuestionA model has a parameter of interest and four nuisance parameters, and you want a 95 percent interval for the parameter of interest. What reference value should you compare the profile statistic to, and why?Show answer

The parameter of interest is a single number, so the test has one degree of freedom, and the reference is the χ12\chi^2_1 95th percentile, 3.8413.841. The four nuisance parameters do not change the degrees of freedom, because they are eliminated by maximising over them. They do affect how good the approximation is, and with many nuisance parameters the profile can mislead.

QuestionGive one reason to be cautious about profile likelihood intervals in a study with a small sample.Show answer

Wilks' theorem is an asymptotic result, so for small samples the true distribution of the statistic can differ substantially from χ12\chi^2_1, and the resulting interval can be too narrow or too wide. Checking against an exact method, or simulating the distribution, is the safer route.

Sources