Derive the uniformly most powerful test of size $\alpha=0.05$ for $H_0: \mu\le \lambda$, v.s. $H_1: \mu>\lambda$

hypothesis testingprobabilityprobability distributionsstatistics

Let $X$ and $Y$ be independent uniform random variables on $[\lambda, \lambda+1]$ and $[\mu, \mu+1] $respectively. The problem of testing $H_0: \mu\le \lambda$, v.s. $H_1: \mu>\lambda$ is invariant under location change $g(X, Y)=(X+c, Y+c)$, $c \in R$. Derive the uniformly most powerful test of size $\alpha=0.05$.


My idea is to use the Neyman-Pearson Lemma. The likelihood ratio test is based on the ratio of the likelihoods under the two hypotheses:
$$
\Lambda=\frac{L_0(x, y)}{ L_1(x, y)}=\frac{I[\lambda<x<\lambda +1]I[\mu <y <\mu+1]}{?}
$$

I am confused about the ratio. And how to proceed the next step? It seems that we need to find
$$
\Lambda>k
$$

Best Answer

We have $\lambda\leq X\leq \lambda +1$ and $\mu\leq Y\leq \mu+1$ a.s. Define $Z=Y-X$. Then $\mu-\lambda-1\leq Z\leq \mu+1-\lambda$ so that $Z \in [\gamma-1,\gamma+1]$ a.s. where $\gamma=\mu-\lambda$. So $H_0:\gamma \leq 0$ and $H_1:\gamma >0$. The Lebesgue density of $Z$ is $f_\gamma(x)=(1-|x-\gamma|)\mathbf{1}_{[0,1]}(|x-\gamma|)$. Now let $\gamma'>\gamma$ be arbitrary. We have $f_{\gamma'}(x)/f_\gamma(x)$ nondecreasing in $x$ whenever at least one of the densities is positive, so it has monotone likelihood in $x$. Then there exists a UMP test of size $\alpha$ of type $$T(x)=\begin{cases} 1&x>c\\ u&x=c\\ 0&x<c \end{cases}$$ We have $P_\gamma(Z=u)=0$ for any $u,\gamma$ so we set $u=0$. We get $E_{\gamma=0}[T(Z)]=P_{\gamma=0}(Z>c)=\alpha$. If $0<\alpha<1/2$ we have $0<c<1$ so $$\int_{c}^1(1-x)dx=\alpha\implies (1-c)-\frac{1-c^2}{2}=\alpha\implies c=1-\sqrt{2\alpha}$$ So if $Z>1-\sqrt{2\alpha}$ we reject $H_0:\gamma\leq 0$.

Related Question