Constructing a Neyman-Pearson Test

I want to construct an NP-Test for simple Null- and Alternative-hypothesis. In particular the likelihood for the Nullhypothesis and Alternativehypothesis is given by $$h_0(x)=\chi_{(-2,2)}(x)\\h_1(x)=\frac{1}{\sqrt{2\pi}}\exp(-\frac{1}{2}x^2)$$ respectively. This means I want to test by considering a sample, if the underlying distribution is uniform on $$(-2,2)$$ or (standard)normally distributed.

First I construct the Likelihoodquotient $$T(x)=\frac{h_1(x)}{h_0(x)}$$ which yields $$T(x)= \begin{cases} \frac{1}{\sqrt{2\pi}}\exp(-\frac{1}{2}x^2),\ -2\le x\le 2\\ \infty, \quad\quad\quad\quad\quad \ \quad\quad\quad \text{else} \end{cases}$$

In the examples I have seen so far it is used that $$T$$ is monotonic, because then I can just refer the the distribution of the data under the Nullhypothesis. But in this case I have no idea on how to proceed.

I somehow have to compute a $$\gamma\in[0,1]$$ and $$k\in[0,\infty)$$ such that $$\alpha=P_0(T>k)+\gamma P_0(T=k)$$ where $$P_0$$ is the probability distribution corresponding to $$h_0$$ and $$\alpha$$ is the significance level.

1) The density of your uniform in (-2,2) is 1/4, not 1. This has an impact on your $$T$$ and $$k$$.

2) You can forget about $$\gamma$$, because both distributions are continuous, so $$P_0(T=k)=0$$.

3) This is somewhat nonstandard because $$T$$ indicates that $$h_1$$ is better outside $$(-2,2)$$, $$h_0$$ is better in a set of the shape $$(-2,-a)\cup(a,2)$$, and $$h_1$$ is better in $$(-a,a)$$, because of symmetry (you can make a drawing to see this). You need to find $$a$$ so that $$P_0[(-2,-a)\cup(a,2)]=1-\alpha$$, which is easy. If you have that, you don't even need $$k$$, or you could read it off easily.

• I like this answer! Could you elaborate on what you mean by "better"? How would I reach your conclusion from merely considering $\alpha=P_0(T>k)$? – EpsilonDelta Jan 7 '20 at 20:06
• "$h_1$ is better" means that $T=h_1/h_0$ is rather large (or, in other words, $h_1$ is relatively large compared to $h_0$, where the word "relatively" is connected to the fact that what values of $T=h_1/h_0$ are taken as "large" depends on $\alpha$ through $k$). If you start thinking from "$\alpha=P_0(T>k)$" you realise that you must choose $k$ in such a way that the set in which $T$ is large enough has probability $\alpha$, or equivalently probability $1-\alpha$ where $T$ is small. This is what I did, I chose a region in which $T$ is small so that its probability is $1-\alpha$. – Lewian Jan 8 '20 at 16:29
• I then realised that this is easier and clearer in terms of $a$ than in terms of $k$. If you have $a$ it isn't difficult to find $k$, but in order to define and run the test, $k$ isn't even needed if you know $a$. – Lewian Jan 8 '20 at 16:31