# F-Test for Equality of Variances as Likelihood Ratio Test

Consider two normally distributed populations with unknown means $$\mu_1$$ and $$\mu_2$$ respectively and unknown variances $$\sigma_1^2$$ and $$\sigma_2^2$$ respectively. Let $$X_1,X_2,\ldots,X_{n_1}$$ and $$Y_1,Y_2,\ldots,Y_{n_2}$$ be i.i.d. random samples drawn independently from these respective populations. Show that a likelihood ratio test of hypotheses $$\mathrm{H}_0: \sigma_1^2=\sigma_2^2$$ vs. $$\mathrm{H}_1: \sigma_1^2 \ne \sigma_2^2$$ is equivalent to the usual $$F$$-Test, i.e. with critical region $$\displaystyle\frac{s_1^2}{s_2^2} \ge f_{1-\alpha/2,n_1-1,n_2-1}$$ if $$s_1^2 \ge s_2^2$$ and $$\displaystyle\frac{s_2^2}{s_1^2} \ge f_{1-\alpha/2,n_2-1,n_1-1}$$ if $$s_1^2 < s_2^2$$ (where $$s_1^2=\displaystyle\frac{1}{n_1-1}\displaystyle\sum_{i=1}^{n_1} (x_i - \bar{x})^2$$, $$s_2^2=\displaystyle\frac{1}{n_2-1}\displaystyle\sum_{i=1}^{n_2} (y_i - \bar{y})^2$$, and $$f_{1-\alpha/2,n_1-1,n_2-1}$$ is the upper $$1-\frac{\alpha}{2}$$ quantile of the $$F$$ distribution with $$n_1-1$$ and $$n_2-1$$ degrees of freedom).

For brevity, let $$SS_x=\sum_{i=1}^{n_1} (x_i-\bar{x})^2$$ and $$SS_y=\sum_{j=1}^{n_2} (y_j-\bar{y})^2$$.

I proceeded as follows: Under $$\mathrm{H}_0$$, the parameter space is $$\{-\infty<\mu_1<\infty,-\infty<\mu_2<\infty,\sigma_1=\sigma_2>0\}$$. Thus \begin{align*} L_0 &= (2\pi \sigma_1^2)^{-n_1/2} e^{-\frac{1}{2\sigma_1^2}\sum_{i=1}^{n_1}(x_i-\mu_1)^2}(2\pi \sigma_1^2)^{-n_2/2} e^{-\frac{1}{2\sigma_1^2}\sum_{j=1}^{n_2}(y_j-\mu_2)^2}\\ &=(2\pi\sigma_1^2)^{-(n_1+n_2)/2} e^{-\frac{1}{2\sigma_1^2}\left[\sum_{i=1}^{n_1}(x_i-\mu_1)^2 + \sum_{j=1}^{n_2} (y_j-\mu_2)^2\right]}\\ \log L_0 &= -\displaystyle\frac{n_1+n_2}{2} \log(2\pi \sigma_1^2) - \displaystyle\frac{1}{2\sigma_1^2}\left[\sum_{i=1}^{n_1}(x_i-\mu_1)^2 + \sum_{j=1}^{n_2} (y_j-\mu_2)^2\right] \\ \displaystyle\frac{\partial L_0}{\partial \mu_1}&=\displaystyle\frac{1}{\sigma_1^2}\sum_{i=1}^{n_1}(x_i-\mu_1)=0 \implies \hat{\mu}_1=\displaystyle\frac{1}{n}\sum_{i=1}^{n_1} x_i = \bar{x} \text{; similarly } \hat{\mu}_2=\bar{y}\\ \displaystyle\frac{\partial L_0}{\partial \sigma_1^2}&=-\frac{n_1+n_2}{2} \left(\frac{2\pi}{2\pi \sigma_1^2}\right)+\frac{1}{2}\left[\sigma_1^2\right]^{-2}\left[\sum_{i=1}^{n_1}(x_i-\mu_1)^2 + \sum_{j=1}^{n_2} (y_j-\mu_2)^2\right]=0\\ &\left[\sigma_1^2\right]^{-2}\left[\sum_{i=1}^{n_1}(x_i-\mu_1)^2 + \sum_{j=1}^{n_2} (y_j-\mu_2)^2\right]=(n_1+n_2)\left[\sigma_1^2\right]^{-1}\\ \hat{\sigma}_1^2&=\frac{1}{n_1+n_2}\left[\sum_{i=1}^{n_1}(x_i-\hat{\mu}_1)^2 + \sum_{j=1}^{n_2} (y_j-\hat{\mu}_2)^2\right]=\frac{1}{n_1+n_2}\left[SS_x+SS_y\right]\\ \therefore \max L_0 &= (2\pi\hat{\sigma}_1^2)^{-(n_1+n_2)/2} e^{-\frac{1}{2\hat{\sigma}_1^2}\left[SS_x+SS_y\right]}\\ &=(2\pi e)^{-(n_1+n_2)/2} \left(\frac{1}{n_1+n_2}\left[SS_x+SS_y\right]\right)^{-(n_1+n_2)/2}\\ L &= (2\pi \sigma_1^2)^{-n_1/2} e^{-\frac{1}{2\sigma_1^2}\left[\sum_{i=1}^{n_1}(x_i-\mu_1)^2\right]} (2\pi \sigma_2^2)^{-n_2/2} e^{-\frac{1}{2\sigma_2^2}\left[\sum_{j=1}^{n_2}(y_j-\mu_2)^2\right]}\\ &\text{M.L.E.'s are \hat{\mu}_1=\bar{x},\hat{\mu}_2=\bar{y},\hat{\sigma}_1^2=\frac{1}{n_1}SS_x,\hat{\sigma}_2^2=\frac{1}{n_2}SS_y}\\ \max L &= (2\pi \hat{\sigma}_1^2)^{-n_1/2} e^{-\frac{1}{2\hat{\sigma}_1^2}SS_x} (2\pi \hat{\sigma}_2^2)^{-n_2/2} e^{-\frac{1}{2\hat{\sigma}_2^2}SS_y}\\ &=(2\pi e)^{-(n_1+n_2)/2} \left(\frac{1}{n_1}SS_x\right)^{-n_1/2} \left(\frac{1}{n_2}SS_y\right)^{-n_2/2} \end{align*} Now, the critical region is of the form $$\lambda =\frac{\max L_0}{\max L} \le k$$ where $$k$$ is some constant. \begin{align*} \lambda =\frac{\max L_0}{\max L}=\frac{(2\pi e)^{-(n_1+n_2)/2} \left(\frac{1}{n_1+n_2}\left[SS_x+SS_y\right]\right)^{-(n_1+n_2)/2}}{(2\pi e)^{-(n_1+n_2)/2} \left(\frac{1}{n_1}SS_x\right)^{-n_1/2} \left(\frac{1}{n_2}SS_y\right)^{-n_2/2}} &\le k\\ \text{Taking both sides to power of -2, }\frac{\left(\frac{1}{n_1+n_2}\left[SS_x+SS_y\right]\right)^{n_1}\left(\frac{1}{n_1+n_2}\left[SS_x+SS_y\right]\right)^{n_2}}{\left(\frac{1}{n_1}SS_x\right)^{n_1} \left(\frac{1}{n_2}SS_y\right)^{n_2}} &\ge k^\prime\\ \left(\frac{n_1}{n_1+n_2}\left[1+\frac{SS_y}{SS_x}\right]\right)^{n_1}\left(\frac{n_2}{n_1+n_2}\left[1+\frac{SS_x}{SS_y}\right]\right)^{n_2} \ge k^\prime\\ \left(1+\frac{SS_y}{SS_x}\right)^{n_1}\left(1+\frac{SS_x}{SS_y}\right)^{n_2} \ge k^{\prime\prime}\\ \end{align*} This is as far as I could simplify it; I am close to expressing the critical region in terms of a ratio of sample variances but cannot see how to get rid of the powers of $$n_1$$ and $$n_2$$.

Taking the critical region $$\left(1+\frac{SS_y}{SS_x}\right)^{n_1}\left(1+\frac{SS_x}{SS_y}\right)^{n_2} \ge k^{\prime \prime}$$, let $$r=\displaystyle\frac{SS_x}{SS_y}$$ and write the left side of the expression as a function of $$r$$, i.e. $$g(r)=(1+r^{-1})^{n_1}(1+r)^{n_2}$$. We can show using calculus that this function has a minimum at $$r=\frac{n_1}{n_2}$$. Thus, $$g(r)$$ increases as we move left or right from this point, and so the inequality $$g(r) \ge k^{\prime \prime}$$ will be satisfied for very small $$r$$ or very large $$r$$. Thus we can rewrite the critical region as $$\displaystyle\frac{SS_x}{SS_y} \le k_1 \cup \displaystyle\frac{SS_x}{SS_y} \ge k_2$$ where $$k_1,k_2$$ are constants. Equivalently, $$\frac{SS_x/(n_1-1)}{SS_y/(n_2-1)}=\frac{s_1^2}{s_2^2} \le k_1^\prime \cup \frac{SS_x/(n_1-1)}{SS_y/(n_2-1)}=\frac{s_1^2}{s_2^2} \ge k_2^\prime$$
Under $$\mathrm{H}_0$$, since $$\sigma_1^2=\sigma_2^2$$, $$S_1^2/S_2^2$$ has an $$F(n_1-1,n_2-1)$$ distribution. Thus, a critical region of size $$\alpha$$ is constructed as follows: \begin{align*} &\Pr\left(\displaystyle\frac{S_1^2}{S_2^2} \le k_1^\prime \cup \displaystyle\frac{S_1^2}{S_2^2} \ge k_2^\prime\right)=\alpha\\ &\Pr\left(\displaystyle\frac{S_1^2}{S_2^2} \le k_1^\prime\right) + \Pr\left(\displaystyle\frac{S_1^2}{S_2^2} \ge k_2^\prime\right)=\alpha\\ &\text{If we divide the type I error prob. equally between the two,}\\ k_1^\prime&= f_{\alpha/2,n_1-1,n_2-1} \text{ and } k_2^\prime=f_{1-\alpha/2,n_1-1,n_2-1} \end{align*} And therefore we can write the critical region as $$\displaystyle\frac{s_1^2}{s_2^2} \le f_{\alpha/2,n_1-1,n_2-1} \cup \displaystyle\frac{s_1^2}{s_2^2} \ge f_{1-\alpha/2,n_1-1,n_2-1}$$.
Finally, if we prefer, we can rewrite $$\displaystyle\frac{s_1^2}{s_2^2} \le f_{\alpha/2,n_1-1,n_2-1}$$ as $$\displaystyle\frac{s_2^2}{s_1^2} \ge \displaystyle\frac{1}{f_{\alpha/2,n_1-1,n_2-1}}$$ and therefore, making use of a property of the $$F$$ distribution, as $$\displaystyle\frac{s_2^2}{s_1^2} \ge f_{1-\alpha/2,n_2-1,n_1-1}$$