Tutorials › Generalized Linear Models › Why Deviance Differences Do Not Test Nonnested Models

Nested Models and Deviance Tests · Tutorial 321 of 981

Why Deviance Differences Do Not Test Nonnested Models

Learn when a deviance difference is a valid nested-model test statistic, and why nonnested comparisons need a different calibration.

Intermediate 10 min read

What You'll Learn

  • Define deviance differences using a common likelihood and saturated-model reference.
  • Derive the likelihood-ratio identity for two candidate models.
  • Explain why nonnested models do not have the nested-model chi-square calibration.
  • Work through Poisson and Gaussian comparisons, including an exact null distribution.
  • Distinguish a difference in fit from a calibrated hypothesis test.

Introduction

A smaller deviance means a model fits better according to its maximized likelihood, provided the models are fitted to the same response data under the same likelihood. But a difference in deviances is not automatically a test statistic. The familiar chi-square reference distribution for a likelihood-ratio statistic depends on a crucial feature: the models must be nested, with one representing a restricted version of the other.

For nonnested models, the difference can have either sign, and there is generally no degrees-of-freedom rule that turns it into a chi-square statistic. The comparison can still describe which model attained the larger likelihood. What it does not provide, by itself, is a calibrated test of one model against the other.

Deviance Differences and the Likelihood Ratio

Let \(M\) be a model fitted to the observed response data, with maximized log-likelihood \(\hat{\ell}_M\). Suppose the same likelihood admits a saturated model with log-likelihood \(\ell_{\mathrm{sat}}\), the largest log-likelihood available when the fitted response means are unrestricted. The deviance of \(M\) is

$$ D(M)=2\{\ell_{\mathrm{sat}}-\hat{\ell}_M\}. $$

The saturated model is a common reference: it is based on the same observations and likelihood, not a separate fitted candidate. For two models \(M_A\) and \(M_B\) with this same reference, subtraction gives

$$ D(M_A)-D(M_B) =2\{\hat{\ell}_{M_B}-\hat{\ell}_{M_A}\}. $$

Thus the difference is twice a log-likelihood difference. Its sign says which candidate has the higher maximized likelihood: a positive value favors \(M_B\), while a negative value favors \(M_A\). This algebra does not establish a sampling distribution or a test.

Definition: Two models are nested if the set of probability distributions allowed by one model is contained in the set allowed by the other. The smaller set is the restricted model, and the larger set is the encompassing model. Models are nonnested when neither allowed set is contained in the other.

If \(M_0\) is nested in \(M_1\), then \(M_1\) can fit at least as well: \(\hat{\ell}_{M_1}\geq\hat{\ell}_{M_0}\). Consequently,

$$ D(M_0)-D(M_1) =2\{\hat{\ell}_{M_1}-\hat{\ell}_{M_0}\}\geq 0. $$

Under the regularity conditions for Wilks' theorem, if \(M_0\) is true and the models have parameter dimensions \(d_0\) and \(d_1\), this likelihood-ratio statistic converges in distribution to \(\chi^2_{d_1-d_0}\). The usual conditions include a fixed dimension difference, an identifiable smooth model, an interior true parameter, and nonsingular Fisher information. Boundary or other nonregular cases require different calibration.

For nonnested models, there is no containment argument guaranteeing a nonnegative difference, and the difference in parameter dimensions is not the Wilks degrees of freedom. Wilks' theorem does not give a chi-square reference distribution for this comparison.

Worked Comparisons

Worked Example: A Nested Poisson Comparison

Suppose two independent Poisson counts are observed, each over exposure 100: \(y_1=200\) and \(y_2=800\). The restricted model \(M_0\) assigns both groups a common rate \(\lambda\); the larger model \(M_1\) assigns them separate rates \(\lambda_1\) and \(\lambda_2\). The common-rate model is nested in the separate-rate model, since it is obtained by imposing \(\lambda_1=\lambda_2\).

Under \(M_0\), the maximum-likelihood rate is the total count divided by total exposure:

$$ \hat{\lambda}=\frac{200+800}{100+100}=5. $$

Under \(M_1\), the fitted rates are \(\hat{\lambda}_1=200/100=2\) and \(\hat{\lambda}_2=800/100=8\). The saturated model has these same fitted rates, so the deviance difference is

$$ D(M_0)-D(M_1) =2\left\{200\log\left(\frac{2}{5}\right) +800\log\left(\frac{8}{5}\right)\right\}. $$

Using \(\log(0.4)\approx-0.916291\) and \(\log(1.6)\approx0.470004\), the quantity inside braces is approximately \(200(-0.916291)+800(0.470004)=-183.258+376.003=192.745\). The statistic is therefore approximately \(385.490\). The models differ by one parameter, so under the common-rate null and regular asymptotic conditions the reference distribution is \(\chi^2_1\). The nesting, not merely the subtraction, is what supplies that calibration.

Worked Example: A Nonnested Gaussian Fit Difference

Let \(Y=(Y_1,Y_2)\) have independent normal components with variance 1. Compare \(M_A\), which specifies the mean vector as \((\beta,0)\), with \(M_B\), which specifies it as \((0,\gamma)\). Neither model contains the other: their mean vectors lie on different axes, and each allows distributions the other does not.

For observed data \(y=(1,2)\), the maximized value of \(\beta\) under \(M_A\) is 1, leaving residual vector \((0,2)\) and residual sum of squares 4. Under \(M_B\), the maximized value of \(\gamma\) is 2, leaving residual vector \((1,0)\) and residual sum of squares 1. Since the variance is fixed at 1, the Gaussian log-likelihood is a common constant minus one half the residual sum of squares. Therefore

$$ D(M_A)-D(M_B)=4-1=3. $$

This value records that \(M_B\) has the higher maximized likelihood for these data. Both models have one parameter, so subtracting their parameter dimensions would give zero; it does not turn 3 into a \(\chi^2_0\) test statistic. Nor does the result establish a general reference distribution. A different data vector can favor \(M_A\).

Why the Nonnested Difference Has No General Chi-Square Law

The failure is not merely that a particular choice of degrees of freedom is difficult to identify. Even in a very simple regular Gaussian example, the deviance difference has a signed distribution that cannot be chi-square.

Result: For the two nonnested Gaussian models \(M_A\) and \(M_B\) above, if the true mean vector is \((0,0)\), then \(D(M_A)-D(M_B)=Y_2^2-Y_1^2\). Its distribution is symmetric about zero and is not a chi-square distribution.

Proof. Under the true mean \((0,0)\), \(Y_1\) and \(Y_2\) are independent \(N(0,1)\) variables. In model \(M_A\), maximizing over \(\beta\) fits \(Y_1\), leaving residual sum of squares \(Y_2^2\). In model \(M_B\), maximizing over \(\gamma\) fits \(Y_2\), leaving residual sum of squares \(Y_1^2\). The common Gaussian likelihood therefore gives

$$ D(M_A)-D(M_B)=Y_2^2-Y_1^2. $$

Swapping \(Y_1\) and \(Y_2\) leaves their joint distribution unchanged and changes the sign of the difference. Also, \(P(Y_2^2=Y_1^2)=0\), since the pair has a continuous joint density and the equality describes a set of area zero. It follows that the difference is negative with probability \(1/2\) and positive with probability \(1/2\). A chi-square variable is nonnegative with probability one, so this difference cannot have a chi-square distribution. \(\square\)

This exact counterexample shows why a nested-model argument cannot simply be reused. In a nested test, the larger model includes the restricted one, so the maximized likelihood cannot decrease, and the null hypothesis corresponds to a restriction within the larger model. For nonnested models, neither feature is guaranteed. A difference can be negative, and there is no parameter-dimension difference that determines its null distribution.

Worked Example: The Same Nonnested Models Under Their Common Mean

Continue with the two Gaussian models, but now use the data \(y=(0,0)\). Model \(M_A\) is maximized at \(\hat{\beta}=0\), and model \(M_B\) at \(\hat{\gamma}=0\). Both leave residual sum of squares 0, so \(D(M_A)-D(M_B)=0\). This does not make zero a test statistic with a \(\chi^2\) calibration: the previous derivation shows that, under this common true mean, the statistic varies across repeated samples, takes either sign, and has probability \(1/2\) of being negative. One observed tie cannot supply the missing reference distribution.

What the Difference Can and Cannot Say

When both models use a common likelihood and saturated reference, their deviance difference is useful as a fit comparison: it is exactly twice the difference in maximized log-likelihoods. A lower deviance identifies the candidate with the better maximized likelihood for the observed data. This descriptive fact is valuable, but it is not a hypothesis test and does not quantify sampling uncertainty.

The common-likelihood qualification matters. If candidate models use different response likelihoods, different data, or different saturated references, their deviances need not subtract to twice a likelihood-ratio statistic at all. Even with a common likelihood, the identity alone does not provide a chi-square distribution. A test requires a null hypothesis and a justified reference distribution.

A common mistake is to say, “Both models are GLMs, so the difference in deviances is chi-square, with degrees of freedom equal to the difference in parameter counts.” The correction is to check nesting first. For a regular nested comparison, the dimension difference gives the Wilks degrees of freedom asymptotically. For two nonnested models, neither the sign nor the null distribution is supplied by that rule. The fitted likelihoods can be compared numerically, but inference needs a method justified for the specific competing hypotheses.

Key takeaway: A shared likelihood makes a deviance difference a likelihood comparison. Nesting and regularity conditions are what make the usual nested likelihood-ratio chi-square calibration valid; a shared likelihood alone is not enough.

Check Your Understanding

Use these questions to check whether you can distinguish a fit comparison from a calibrated test.

  1. For two models with a common saturated log-likelihood, write the identity connecting their deviance difference to their maximized log-likelihoods.
  2. Why is the deviance difference nonnegative when comparing a restricted model with its encompassing model?
  3. In the Gaussian example with mean vectors \((\beta,0)\) and \((0,\gamma)\), what does a positive value of \(D(M_A)-D(M_B)\) say about the observed-data fit?
  4. Why does a statistic that is negative with positive probability fail to have a chi-square distribution?
  5. What features, beyond using GLMs and subtracting deviances, justify the usual Wilks chi-square reference distribution?
Clinical Biostats