Search

Search papers and lessons

Nuisance Parameter

Level 3 · 10 min read

A nuisance parameter is a quantity a model needs in order to fit the data but that you do not want to report, and methods such as profiling or marginalising remove it without ignoring its uncertainty.

On this page

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

TL;DR

Most models have more than one unknown. A study asks about one quantity, the parameter of interest, but the model also needs others to describe the noise or the setting. Those others are nuisance parameters. You need them to fit the model, and you do not want to report them. The job is to use them to get a clean answer about the parameter of interest, without pretending they are known.

Where you'll see it: the unknown noise level in a measurement, the baseline rate in a comparison of two treatments, and the variance in a regression whose slope is what you care about.

Intuition

Start from a question you already know

You want to know how far a delivery van travels per litre of fuel. You have trip logs, but each trip also depends on traffic, which you did not record. Traffic is not what you asked about. It still changes every trip's fuel use, so you cannot ignore it. A good analysis estimates the fuel efficiency while letting traffic vary, then reports only the efficiency. Traffic is a nuisance: necessary to model, unwanted in the answer.

In statistics the same thing happens with a model. Take a Gaussian measurement with unknown mean μ\mu and unknown spread σ\sigma (the standard deviation, whose square is the variance; see Mean and Variance). If you care about μ\mu, then σ\sigma is a nuisance. You cannot write down the likelihood of μ\mu alone without deciding what σ\sigma is, but the final answer should be about μ\mu.

The two bad answers

There are two tempting shortcuts, and both are wrong in general.

The first is to guess the nuisance value and treat it as known. If you pick σ=1\sigma = 1 because it feels right, your confidence about μ\mu will be too narrow or too wide depending on the truth. The uncertainty about σ\sigma has been silently thrown away.

The second is to ignore the nuisance by fitting a simpler model. This often fails because the nuisance changes what the data say about the parameter of interest. The methods in this lesson are the careful versions of these two ideas: they use the data to estimate the nuisance, or they average over its possible values.

−101234500.20.40.60.81mean μrelative likelihood
  • profile: best σ for each μ
  • fixed σ = 0.5
Two curves for the mean, both peaking at 2. Computed from the two observations 1 and 3 used in Example 1. Fixing the nuisance spread at a small value (0.5) gives a sharper curve, which overstates how well the data pin down μ. Profiling lets the spread change with μ, so its curve is wider and more honest.

The math

Setting up

Let θ\theta be the parameter of interest and λ\lambda the nuisance parameter. The full model has a density f(x;θ,λ)f(x; \theta, \lambda) for each observation. Given independent observations x1,…,xnx_1, \dots, x_n, the likelihood is

L(θ,λ)=∏i=1nf(xi;θ,λ).L(\theta, \lambda) = \prod_{i=1}^{n} f(x_i; \theta, \lambda).

Here LL scores each pair of values by how probable the data would be under them. The log-likelihood ℓ(θ,λ)=log⁡L(θ,λ)\ell(\theta, \lambda) = \log L(\theta, \lambda) is easier to work with, because it turns the product into a sum. The task is to say something about θ\theta while λ\lambda is unknown.

Method 1: profiling

For each fixed value of θ\theta, find the best nuisance value, the one that maximises the likelihood:

λ^(θ)=arg⁡max⁡λ ℓ(θ,λ).\hat{\lambda}(\theta) = \arg\max_{\lambda} \, \ell(\theta, \lambda).

Then substitute it back in. The result is the profile log-likelihood

ℓp(θ)=ℓ(θ,λ^(θ)).\ell_p(\theta) = \ell(\theta, \hat{\lambda}(\theta)).

The symbol arg⁡max⁡\arg\max means "the value of the thing below that makes the expression largest". The profile curve depends only on θ\theta, so you can plot it, find its peak, and read off intervals, as with a one-parameter model. Its peak is the maximum likelihood estimate of θ\theta in the full model. The full treatment, including the likelihood-ratio test, is in Profile Likelihood.

Method 2: marginalising

If you have a prior π(λ)\pi(\lambda) over the nuisance (your beliefs about it before seeing the data), you can average it out. The marginal likelihood for θ\theta is

Lm(θ)=∫L(θ,λ) π(λ) dλ.L_m(\theta) = \int L(\theta, \lambda) \, \pi(\lambda) \, d\lambda.

The integral sign ∫\int means "add up over every value of λ\lambda", weighting each by π(λ)\pi(\lambda). This is the Bayesian route, and it spreads the answer over the nuisance uncertainty rather than fixing it at its best value.

A key special case

Sometimes the nuisance does not affect the best value of the parameter of interest at all. This happens in a linear model with no intercept and an unknown noise variance: the least squares slope is the same whatever the noise variance is. Then profiling over the variance leaves the slope unchanged, and only the uncertainty depends on the nuisance.

Worked examples

Example
Example 1: a mean with an unknown spread (hand-computable)

Two observations, x=(1,3)x = (1, 3), come from a Gaussian with mean μ\mu (the parameter of interest) and variance σ2\sigma^2 (the nuisance).

  1. For a fixed μ\mu, the best variance is the average squared distance from μ\mu: σ^2(μ)=(1−μ)2+(3−μ)22\hat{\sigma}^2(\mu) = \frac{(1-\mu)^2 + (3-\mu)^2}{2}.
  2. Expand the numerator: (1−μ)2+(3−μ)2=2μ2−8μ+10(1-\mu)^2 + (3-\mu)^2 = 2\mu^2 - 8\mu + 10. Divide by 2: σ^2(μ)=μ2−4μ+5=(μ−2)2+1\hat{\sigma}^2(\mu) = \mu^2 - 4\mu + 5 = (\mu - 2)^2 + 1.
  3. The profile log-likelihood for two observations is, up to a constant, ℓp(μ)=−log⁡σ^2(μ)=−log⁡((μ−2)2+1)\ell_p(\mu) = -\log \hat{\sigma}^2(\mu) = -\log\left((\mu-2)^2 + 1\right).
  4. Its peak is at μ=2\mu = 2, where σ^2=1\hat{\sigma}^2 = 1 and ℓp=0\ell_p = 0. That is the sample mean, as expected.
  5. At μ=0\mu = 0, σ^2=5\hat{\sigma}^2 = 5, so ℓp=−log⁡5≈−1.609\ell_p = -\log 5 \approx -1.609. The drop from the peak is 1.6091.609.

Interpretation: the profile curve tells you how much the data disfavour μ=0\mu = 0 after letting the spread adjust. The spread was estimated, not fixed.

Example
Example 2: a textbook bias in the nuisance estimate

Three observations, x=(2,4,6)x = (2, 4, 6), come from a Gaussian with unknown mean μ\mu and variance σ2\sigma^2. Suppose the mean is the parameter of interest.

  1. The sample mean is xˉ=4\bar{x} = 4. The sum of squared deviations is (2−4)2+(4−4)2+(6−4)2=4+0+4=8(2-4)^2 + (4-4)^2 + (6-4)^2 = 4 + 0 + 4 = 8.
  2. The maximum likelihood estimate of the variance divides by nn: σ^ML2=8/3≈2.667\hat{\sigma}^2_{\text{ML}} = 8/3 \approx 2.667.
  3. The usual unbiased estimate divides by n−1=2n - 1 = 2: s2=8/2=4s^2 = 8/2 = 4.
  4. The profile estimate of the mean is μ^=4\hat{\mu} = 4, and it does not depend on which variance you use.

Interpretation: the nuisance estimate from the likelihood is too small on average, because it uses the sample mean that the data themselves picked. With few observations this matters. The estimate of the parameter of interest is unaffected here, but a confidence interval built from the variance would be too narrow if you used σ^ML2\hat{\sigma}^2_{\text{ML}} carelessly. Profiling does not fix this bias by itself.

Example
Example 3: a regression slope with an unknown noise level

Model (a linear regression through the origin): y=βx+εy = \beta x + \varepsilon, where ε\varepsilon is Gaussian noise with unknown variance σ2\sigma^2. The slope β\beta is the parameter of interest, and σ2\sigma^2 is the nuisance. Data: x=(1,2,3)x = (1, 2, 3) and y=(2.1,3.9,6.2)y = (2.1, 3.9, 6.2).

  1. ∑xy=2.1+7.8+18.6=28.5\sum xy = 2.1 + 7.8 + 18.6 = 28.5 and ∑x2=14\sum x^2 = 14.
  2. Best slope for any noise level: β^=28.5/14≈2.036\hat{\beta} = 28.5 / 14 \approx 2.036. The noise variance cancels out of the slope's best value, so profiling leaves β^\hat{\beta} unchanged.
  3. Fitted values: 2.0362.036, 4.0714.071, 6.1076.107. Residuals: 0.0640.064, −0.171-0.171, 0.0930.093.
  4. Sum of squared residuals: 0.0041+0.0294+0.0086≈0.04210.0041 + 0.0294 + 0.0086 \approx 0.0421, which equals 0.59/140.59 / 14.
  5. Estimated noise variance: σ^2=0.0421/3≈0.0140\hat{\sigma}^2 = 0.0421 / 3 \approx 0.0140. The unbiased version divides by n−p=3−1=2n - p = 3 - 1 = 2, since one slope was estimated, giving about 0.02110.0211.

Interpretation: the slope is about 2.04, and the data are tight, since the residuals are about 0.1. The noise variance is needed to say how sure you are about the slope, but it does not change the slope itself. This is the case where profiling is cheap and clean.

Tradeoffs and failure modes

SituationProblemBetter choice
Few observationsProfiling underestimates uncertainty in θ\thetaUse an adjusted method or a Bayesian marginal
The nuisance count grows with the sample sizeThe maximum likelihood estimate of θ\theta can be inconsistentConditional or marginal likelihood
You have real prior knowledge about λ\lambdaProfiling ignores itMarginalise with that prior
The nuisance is not identified by the dataIts best value is arbitraryFix it from outside information, or reparameterise
The nuisance changes the best θ\thetaFixing it gives a wrong answerProfile or marginalise, never fix

The classic warning is a paper by Neyman and Scott from 1948. In their setting, each new observation brings a new nuisance parameter, so the number of nuisance parameters grows with the data. Maximum likelihood then gives an estimate of the parameter of interest that does not converge to the truth, however much data you collect. Profiling is not a universal fix.

History

Ronald Fisher built the modern likelihood approach in the 1920s. Working with nuisance parameters became a standard part of statistical theory after that, because almost every real model has more than one unknown.

The Neyman and Scott paper of 1948 showed the limits of simple profiling, and it led to conditional likelihood methods. In 1971 Patterson and Thompson introduced restricted maximum likelihood (REML), which estimates variance components by removing the effect of the fixed parameters first. REML is a standard tool for mixed models, and it is one way to handle nuisance variances without the downward bias of plain maximum likelihood.

The phrase "nuisance parameter" is now used across statistics, and it appears in clinical trials, astronomy and physics, where a calibration constant or a background rate is usually a nuisance.

Recap

A model with an interest parameter θ\theta and a nuisance λ\lambda needs a way to remove λ\lambda. Profiling replaces λ\lambda with its best value for each θ\theta, and the result is a one-parameter curve you can read. Marginalising averages λ\lambda over a prior. Both are sound when the nuisance is well identified and the sample is large enough. When the number of nuisance parameters grows, or the sample is small, the simple versions can mislead, and conditional or restricted methods are the next step. For the curve itself, see Profile Likelihood, for the estimator bias seen in Example 2 see Bias-Variance Tradeoff, and for the intervals built from it, see Confidence Interval.

Check yourself

QuestionRecall: what is the difference between a parameter of interest and a nuisance parameter?Show answer

The parameter of interest is the quantity the analysis is designed to answer, such as a mean or a slope. A nuisance parameter is needed to write down the model and fit the data, such as a noise variance or a background rate, but it is not reported as the answer. Both are unknown, and both are estimated from the same data.

QuestionComputation: with x=(1,3)x = (1, 3) and a Gaussian model with mean μ\mu and variance σ2\sigma^2, what is the best variance when μ=0\mu = 0?Show answer

The best variance for a fixed mean is the average squared distance from it: σ^2=(1−0)2+(3−0)22=1+92=5\hat{\sigma}^2 = \frac{(1-0)^2 + (3-0)^2}{2} = \frac{1 + 9}{2} = 5. This matches the formula (μ−2)2+1(\mu - 2)^2 + 1 at μ=0\mu = 0, which gives 4+1=54 + 1 = 5.

QuestionWhy: why does fixing the nuisance at one value tend to make a confidence statement about the parameter of interest too narrow?Show answer

Fixing the nuisance pretends it is known exactly, so the uncertainty in the nuisance does not reach the answer. In the Gaussian example, a fixed, small spread gives a sharper likelihood curve for the mean than the profile curve, which lets the spread change with the mean. The profile curve is wider and reflects the data's real uncertainty.

QuestionApplied: in a regression of yy on xx with an unknown noise variance, you care only about the slope. Does the noise variance change the best slope estimate, and what should you do?Show answer

For a model with no intercept, the least squares slope ∑xy/∑x2\sum xy / \sum x^2 does not depend on the noise variance, so profiling leaves the slope estimate unchanged. The noise variance still matters for the uncertainty about the slope, so estimate it from the residuals and use it when forming intervals. Use the n−pn - p correction, where pp is the number of slopes estimated, when the sample is small, since the plain maximum likelihood variance is biased downward.

Sources