Solution (source code)

= Solution

Let $W=2[\ell(\widehat\theta)-\ell(\widetilde\theta)]$ be a regular <likelihood-ratio test statistic> for $r$ smooth restrictions, so its leading null law is $\chi_r^2$. Suppose a higher-order calculation gives $\mathbb E_0W=r+a/n+O(n^{-2})$. The <Bartlett correction> rescales the statistic:
$$
\boxed{W_B=\frac{W}{1+a/(rn)}.}
$$
Its mean is $r+O(n^{-2})$, eliminating the first-order mean error. In regular <likelihood> models satisfying the usual Bartlett expansion, the same scaling removes the leading $n^{-1}$ distributional error against the chi-square reference law, leaving an $O(n^{-2})$ error for fixed tail probabilities. Matching a mean alone would not establish this distributional conclusion for an arbitrary statistic.

The coefficient depends on the model, null restrictions and <nuisance parameters>; it can be obtained from higher derivatives and <cumulants> of the <log-likelihood>, or estimated by null simulation when an analytic expression is inconvenient. <Nuisance parameters> require their appropriate null values or estimates. A correction improves finite-sample calibration within regular asymptotic theory; it does not turn a boundary-parameter or unidentifiable problem into a regular chi-square problem.