Likelihood-ratio test for equality of exponential means (source code)

= Likelihood-ratio test for equality of exponential means
{title2=$\Lambda=\frac{(n+m)^{n+m}}{n^nm^m}T^n(1-T)^m$}

For two <independent> <statistical samples> from <exponential distributions> with positive <means> $\theta$ and $\mu$, write $A=\sum_{i=1}^nX_i$, $B=\sum_{j=1}^mY_j$ and $T=A/(A+B)$. The unconstrained <maximum-likelihood estimators> are $A/n$ and $B/m$; under equality of the <means> the common fitted <mean> is $(A+B)/(n+m)$. Dividing the constrained maximum <likelihood function> by its unrestricted maximum gives the displayed <likelihood ratio>. Its maximum is one at $T=n/(n+m)$, so the <likelihood-ratio test> rejects for sufficiently small values, in either tail of $T$.

Under the <null hypothesis>, the sums have independent <gamma distributions> with a common rate, so $T\sim\operatorname{Beta}(n,m)$ by <beta sampling by gamma ratios>. This permits exact calibration. For large samples with $n/(n+m)\to\rho\in(0,1)$, the <Wilks theorem> gives $-2\log\Lambda\xrightarrow d\chi^2_1$. Its upper-tail <probability> is the asymptotic <p-value>. The one <statistical degree of freedom> is the difference between the unrestricted and constrained parameter dimensions.