AI Glossary / Statistics and probability / Advanced
Nested hypothesis
Definition
Nested hypotheses form an ordered sequence in which every hypothesis permits only possibilities also permitted by each later hypothesis. In statistical models, this usually means that a smaller model is obtained by imposing restrictions on a larger one. The nesting concerns sets of permitted distributions or parameter values, not simply the order in which tests are performed.
What it means
For example, a model requiring two regression coefficients to be zero is contained in a model allowing one of them to vary, which is contained in a model allowing both to vary. Broader models permit more possibilities; they do not automatically give better predictions on new observations.
How it works
Write down the permitted model family at each stage and identify the restrictions linking the stages. Then check that every permitted smaller-model case can be represented by the larger model. A comparison procedure must match the model and assumptions. In ordinary regression, a classical F comparison uses residual sums of squares and the number of independent restrictions; its validity requires more than nesting alone.
Three practical examples
- An analyst compares a constant forecast, a forecast using one predictor, and a forecast using two predictors. Setting the added coefficients to zero recovers the earlier models.
- A research team starts with a shared effect across groups and then allows separate group effects. The shared-effect model is nested when it is recovered by setting all group differences to zero.
- A reviewer compares models using different predictor sets. Even if one has fewer coefficients, it is not necessarily contained in the other. The reviewer checks representability rather than relying on parameter counts.
Think of it this way
Imagine three sets of permitted recipes. The first allows only a base ingredient, the second allows an optional addition, and the third allows two optional additions. Every recipe from the first appears in the second and third.
Worked example
Consider an original eight-observation regression example. The predictor x has values -1, -1, -1, -1, 1, 1, 1, and 1. A second predictor z has values -1, -1, 1, 1, -1, -1, 1, and 1. Outcomes y are 6, 8, 8, 10, 10, 12, 12, and 14.
Define three mean-model families. M0 permits only a constant mean a. M1 permits a + bx. M2 permits a + bx + cz. Use the same outcome, observations, and error-model framework throughout. M0 is obtained from M1 by setting b = 0. M1 is obtained from M2 by setting c = 0. Thus M0 is contained in M1, and M1 is contained in M2.
The fits simplify because x and z each sum to zero, have sum of squares eight, and have cross-product zero. The fitted M0 mean is 10. The fitted M1 mean is 10 + 2x. The fitted M2 mean is 10 + 2x + z.
M0 has residual sum of squares 48. M1 reduces it to 16. M2 reduces it to 8. Its residuals alternate -1 and +1, so their squared values sum to eight. The corresponding residual degrees of freedom are seven, six, and five, because the three mean models have one, two, and three independently estimable coefficients.
For M1 versus M2, the extra predictor removes eight units of residual sum of squares at the cost of one additional coefficient. The classical statistic is [(16-8)/1] divided by [8/5] = 5. Under the null restriction c = 0 and independent Gaussian errors with common variance, its reference distribution is F with one and five degrees of freedom. The calculated value alone does not provide a universal decision without a chosen significance level and the corresponding reference distribution.
For M0 versus M2, the joint restriction is b = c = 0. The statistic is [(48-8)/2] divided by [8/5] = 12.5, using two and five degrees of freedom. This joint question differs from asking only whether c adds information after x is already included.
Now consider another family, Mz, permitting a + cz but no x term. M1 and Mz each have two mean coefficients. Neither contains the other on this design: the x pattern cannot be reproduced by a constant and z, and the z pattern cannot be reproduced by a constant and x. Both are contained in M2, and their shared constant-only family is M0. Nesting is therefore a relationship between specified families, not a ranking by model size.
The decreasing training sums of squares are expected: enlarging a least-squares model preserves every fit available before. They do not prove that M2 will forecast future outcomes better. That requires a separate assessment of prediction performance and the data-generating setting.
Illustrative case study
This fictional case concerns Alder Forecasting, an imaginary analytics team. Its report labels every smaller model nested and compares two different single-predictor models using the ordinary nested-model F procedure. A reviewer identifies the representability problem illustrated by M1 and Mz.
The revised report separates nested comparisons from comparisons between different predictor families. It also evaluates forecasts on held-out observations and checks residual behavior before interpreting the classical tests. The case illustrates model specification, not a measured commercial improvement.
Common misconceptions and mistakes
A larger likelihood or smaller training error does not establish substantive superiority. Nor does failing to reject a restriction prove it exactly true.
Changing the response transformation, observation set, or error specification can invalidate a proposed comparison even when predictor names look nested. Collinearity can also make the number of independent restrictions differ from a naive count of added columns. Nested hypotheses are distinct from nested sampling, hierarchical data, and nested cross-validation.
Business use
State the restriction and decision it represents. A zero coefficient might ask whether an expensive measurement improves a specified model, but statistical evidence is only part of that purchase decision. Consider prediction benefit, measurement costs, stability, and the consequences of model errors. Avoid selecting a complex model solely because it fits historical data more closely.
People also ask
Does nesting make a test valid automatically?
No. For example, the conventional regression F comparison is not generally valid under unspecified unequal error variances or correlated errors.
Can several models be nested in a common larger model without being nested in each other?
Yes: M1 and Mz demonstrate that situation.
Check your understanding
Which restriction recovers M1 from M2?
Answer: Set c to zero.
Why does the joint M0-versus-M2 statistic divide the improvement by two?
Answer: It tests two independent coefficient restrictions together.
Related terms
- Parameter space
- Degrees of freedom
- Model selection
- Collinearity
- Overfitting
- Restricted model
- likelihood-ratio test
- extra-sum-of-squares F test
Learn next
Fit the three models to the eight observations and verify each residual sum of squares. Then show algebraically why neither single-predictor family contains the other.
More in Statistics and probability
- Nelson - Aalen estimator - The Nelson - Aalen estimator estimates a cumulative hazard function from time-to-event data.
- Nemenyi test - The Nemenyi test is a rank-based multiple-comparison procedure.
- Nested case - control study - A nested case - control study selects cases and controls from a defined cohort.
- Nested sampling algorithm - Nested sampling is a numerical method for estimating Bayesian evidence and obtaining weighted posterior samples.
- Net reclassification improvement - Net reclassification improvement, or NRI, compares how two risk-prediction models move observations upward or downward in predicted risk.
- Network sampling - Network sampling is a survey approach in which a target item can be reported through several linked sampling units.
Sources
OECD Glossary of Statistical Terms, Nested hypothesis, printed page 353: https://www.oecd.org/content/dam/oecd/en/publications/reports/2008/09/oecd-glossary-of-statistical-terms_g1gh9ad7/9789264055087-en.pdf . statsmodels, OLSResults.compare_f_test, assumptions and restricted-model comparison: https://www.statsmodels.org/stable/generated/statsmodels.regression.linear_model.OLSResults.compare_f_test.html . Data, calculations, and Alder Forecasting are original illustrations.
Previous: Nested cross-validation Next: Nested Loop