# Most powerful test for deciding probability mass function

Let $$X$$ be an integer valued random variable supported on $$\{0.1.2...,12\}$$ whose pmf is either $$g(x)=1/13; x=0,1,...,12$$ or

$$f(x)=\dfrac x {36} 1_{\{0,1,...,6\}} + (\dfrac 13 - \dfrac x{36})1_{\{7,8,...,12\}}; x =0,1,...,12$$. (where $$1_A$$ denotes the indicator function of a set $$A$$)

On the basis of one single observation $$X$$, how to construct the most powerful test of

$$H_0:$$ pmf of $$X$$ is $$f$$ vs. $$H_1:$$ pmf of $$X$$ is $$g$$ , at a $$0.25$$ level of significance ?

I don't know, have never encountered, testing hypothesis for pmf before ... I have only known testing hypothesis for parameter.

A detailed solution of this, with some relevant reading material will be much appreciated.

Thanks in advance.

• @StubbornAtom: not homework but a past exam question ... – user521337 Jan 8 at 6:26
• Even then, please add self-study. Also, please tell us what you have tried so far. – StatsStudent Jan 8 at 6:46
• @StatsStudent: as I said ... I only know how to use Neyman-Pearson for parameter hypothesis testing ... I don't know how to apply N-P to test pmf or pdf hypothesis ... – user521337 Jan 8 at 7:18
• The distribution is fully specified under both models, so you can directly calculate likelihood of any observation under null and alternative and so calculate the likelihood ratio as a function of $x$. Indeed since the null is uniform, one can proceed directly from inspection of the alternative. Consequently, the form of the rejection region (in terms of $x$) is obvious - the only question is where the boundary is placed, which is determined by $\alpha$ (keeping in mind that the location of the cutoff is determined under the null) – Glen_b Jan 9 at 3:23

## 1 Answer

Recall the construction of most powerful test using the fundamental Neyman-Pearson lemma.

Consider the problem of testing a simple null against a simple alternative, namely $$H_0:X\sim f_0\quad\text{ vs }\quad H_1:X\sim f_1\,(\ne f_0)$$

, where $$X$$ is a random variable/vector, $$f_0$$ (or $$f_{H_0}$$) is the null distribution which is completely specified, and $$f_1$$ (or $$f_{H_1}$$) is the alternative distribution which is also completely specified.

Then any test $$\varphi$$ of the form

$$\varphi(x)=\begin{cases}1&,\text{ if }f_1(x)>kf_0(x)\\ \gamma&,\text{ if }f_1(x)=kf_0(x)\\0&,\text{ if }f_1(x)

where $$\gamma\in(0,1)$$ and $$k>0$$ are such that $$\varphi$$ is of size $$\alpha$$, is a most powerful size $$\alpha$$ test for testing $$H_0$$ against $$H_1$$.

Since you are familiar with hypothesis testing of parameters using N-P lemma, the above would not come as much of a surprise. After all, if your distribution $$f$$ was indexed by the parameter $$\theta$$ you would do the same thing for testing, say, $$H_0:\theta=\theta_0$$ vs $$H_1:\theta=\theta_1\,(\ne\theta_0)$$. In that case, $$f_0$$ becomes $$f_{\theta_0}$$ and $$f_1$$ becomes $$f_{\theta_1}$$.

To get you started, let $$f$$ be the pmf of $$X$$.

Since both the null and alternative distributions are discrete, a most powerful level $$\alpha=0.25$$ test for testing $$H_0$$ against $$H_1$$ is simply of the form

$$\varphi(x)=\begin{cases}1&,\text{ if }x\in E\\0&,\text{ otherwise }\end{cases}$$

, where $$E_{H_0}\varphi(X)\le 0.25$$

To choose the set of points in $$E$$, compute the likelihood ratio $$\lambda(x)=\frac{f_{H_1}(x)}{f_{H_0}(x)}$$ for each $$x$$, and write the different values of $$\lambda(x)$$ in decreasing order (because we reject $$H_0$$ for large values of $$\lambda(x)$$).

For this question, the order looks something like $$\lambda(0)=\lambda(12)>\lambda(1)=\lambda(11)>\ldots\tag{*}$$

The critical region $$E$$ would consist of sample points taken according to the preference rule $$(*)$$. So here $$0,12$$ would be the first values to enter into $$E$$, and so on until $$E_{H_0}\varphi(X)$$ exceeds $$0.25$$.

[The test $$\varphi$$ might not be an exact size $$\alpha$$ test, in which case you would have to use randomisation.]

• as I said ... I only know how to use Neyman-Pearson for parameter hypothesis testing ... could you please add some reference as to where to find application of N-P to test pmf or pdf hypothesis ? – user521337 Jan 8 at 7:17
• @user521337 This is a direct application of N-P lemma and is a more general question than testing of parameters. So I would guess a standard mathematical statistics textbook would discuss these problems, worked out or as exercise. If you are testing say, $H_0:\theta=\theta_0$ vs $H_1:\theta=\theta_1 (\ne \theta_0)$, you would use the ratio $\lambda(x)=f_{H_1}(x)/f_{H_0}(x)=f_{\theta_1}(x)/f_{\theta_0}(x)$. Does this look more familiar? – StubbornAtom Jan 8 at 7:32
• @user521337 I have updated my answer a little to focus on this particular exercise. Let me know if things are not clear. – StubbornAtom Jan 12 at 14:52
• thank you for your solution here very much ... could you also possibly take a look at these two questions stats.stackexchange.com/questions/386254/… and stats.stackexchange.com/questions/386815/… – user521337 Jan 12 at 15:51