# Testing whether $X\sim\mathsf N(0,1)$ against the alternative that $f(x) =\frac{2}{\Gamma(1/4)}\text{exp}(−x^4)\text{ }I_{(-\infty,\infty)}(x)$

Consider the most powerful test of the null hypothesis that $$X$$ is a standard normal random variable against the alternative that $$X$$ is a random variable having pdf

$$f(x) =\frac{2}{\Gamma(1/4)}\text{exp}(−x^4)\text{ }I_{(-\infty,\infty)}(x)$$

and give the p-value if the observed value of $$X$$ is $$0.6$$

My try:

I think I should be using a likelihood ratio test.

I read that the Neyman–Pearson lemma states that the likelihood ratio test is the most powerful among all level $$\alpha$$ tests.

We have that the likelihood ratio is

$$\frac{f_0(x)}{f_1(x)}=\frac{\frac{1}{\sqrt{2\pi}}\text{exp}(-x^2/2)}{\frac{2}{\Gamma(1/4)}\text{exp}(-x^4)}=\frac{\Gamma(1/4)}{\sqrt{8\pi}}\text{exp}\left(\frac{-x^2}{2}+x^4\right)$$

Thus we accept $$H_0$$ if

$$\frac{\Gamma(1/4)}{\sqrt{8\pi}}\text{exp}\left(\frac{-x^2}{2}+x^4\right)\geq c$$

or equivalently if

$$\frac{-x^2}{2}+x^4 \geq \text{log}\left(\frac{\sqrt{8\pi}\cdot c}{\Gamma(1/4)}\right)$$

or equivalently if one of the following holds:

$$x^2\geq \frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}$$

$$x^2\geq \frac{1-\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}$$

or equivalently if one of the following holds:

$$x\geq \sqrt{\frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}$$

$$x\leq -\sqrt{\frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}$$

$$x\geq \sqrt{\frac{1-\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}$$

$$x\leq -\sqrt{\frac{1-\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}$$

For a meaningful acceptance region we only consider the top two of the four constraints. Hence we reject if $$x\in\left(-\sqrt{\frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}},\sqrt{\frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}\right)$$

We wish, under the null, that the probability that $$X$$ assumes a value in this range to be $$0.05$$

For this to occur, we need

$$\sqrt{\frac{1+\sqrt{1+16\cdot\text{log}(1.382746\cdot c)}}{4}}=0.06270678$$

But software gives that there are no solutions for $$c\in\mathbb{R}$$. Any suggestions or confirmation of my approach would be much appreciated.

• One of the roots of the bi-quadratic equation is negative because $c\ge\frac{\Gamma(1/4)}{\sqrt(8 \pi)}$, therefore you only will have the condition that |x|>... – sega_sai Dec 2 '18 at 1:52
• Am I correct in saying that it must be that $0\leq 1+16\cdot\text{log}(1.382746\cdot c)\leq 1$ and so $c\in(0.679,0.723)$? – Remy Dec 2 '18 at 1:58
• No. $1\le1+16\log(\frac{\Gamma(1/4)}{\sqrt{2\pi}} c)$ for all meaningful c. – sega_sai Dec 2 '18 at 2:31
• That would make the bottom two of my four constraints undefined so should I only be concerned with the top two? – Remy Dec 2 '18 at 2:34
• You are doing something incorrect here. To find out the c for a given p-value, you need to consider the distribution of you statistic under null -- in this case your TS is $\frac{\Gamma(1/4)}{\sqrt{8 \pi}}\exp(-x^2/2+x^4)$ and find out what value corresponds to 0.05/0.95 tail probality. That's what you need to use as a $c$. But the answer below by StubbornAtom is the right one anyway. – sega_sai Dec 2 '18 at 7:59

Possible way to proceed:

By N-P lemma, a most powerful test of size $$\alpha$$ for testing $$H_0$$ against $$H_1$$ is the indicator function

$$\varphi(x)=\mathbf1_{\lambda(x)>k}$$

, where $$\lambda(x)=\frac{f_{H_1}(x)}{f_{H_0}(x)}$$ and $$k$$ is so chosen that $$E_{H_0}\varphi(X)=\alpha$$

Now,

$$\lambda(x)\propto\frac{e^{-x^4}}{e^{-x^2/2}}=\exp\left(-x^4+x^2/2\right)$$

Or, $$\ln \lambda(x)=\frac{x^2}{2}-x^4+\text{ constant }$$

Log being monotonically increasing, it suffices to study the nature of this function. You can consider this to be a function of $$x^2$$, plot the function, differentiate and check the sign of the derivative. We are interested to know whether $$\lambda(x)$$ is increasing or decreasing in $$x$$, or both increasing and decreasing for different values of $$x$$.

Ultimately you would have to reach some conclusion regarding $$x$$ from $$\lambda(x)$$ if possible, like

$$\lambda(x)>k\implies k_1

Apart from possible relations between $$c_1,c_2$$ which can be found through the analysis above, additional constraint on $$c_1,c_2$$ is of course the size (or level) restriction.

The critical region gets complicated if you go into details.

For $$\lambda(x)>k$$, we have for some $$k_1$$,

\begin{align} \frac{x^2}{2}-x^4&>k_1 \\\implies x^4-2x^2\cdot\frac{1}{4}+\frac{1}{16}&<\frac{1}{16}-k_1 \end{align}

Or, $$\left(x^2-\frac{1}{4}\right)^2<\frac{1}{16}-k_1$$

So for some $$c$$, the critical region is the set of all $$x$$ such that

\begin{align} \left|x^2-\frac{1}{4}\right|

You can stop here. If you want you can solve this further for $$x$$, but not necessary I think.

If you can find $$c$$ such that $$P_{H_0}(-c+\frac{1}{4}, then a level $$\alpha$$ MP test is ready using N-P lemma. You know that under $$H_0$$, $$X^2$$ has a $$\chi^2_1$$ distribution.

• Thank you, I will reattempt with this in mind and edit my post – Remy Dec 1 '18 at 21:50
• Just to make sure, we want $\mathsf P\left(\frac{\sqrt{8\pi}}{\Gamma(1/4)}\text{exp}\left(\frac{x^2}{2}-x^4\right)\gt k\right)=0.05$? – Remy Dec 1 '18 at 23:00
• So we reject the null hypothesis if our observation squared falls between $-c+\frac{1}{4}$ and $c+\frac{1}{4}$? And would the desired p-value then just be the probability of a chi-square random variable taking on a value less than $0.36$? – Remy Dec 2 '18 at 8:04
• @Remy I am afraid you need expert opinion on that. The purpose of my answer was to show how the critical region could be simplified using N-P lemma. If my test statistic is $T=X^2$, observed value of $T$ is $t=0.6^2=0.36$. I am not sure what exactly is the p-value in this setup. (It could be $P_{H_0}(T\ge t)$ or $P_{H_0}(T\le t)$ or twice the minimum of the two probabilities.) If the level is $\alpha$ (known), then you are to reject $H_0$ if the p-value is less than or equal to $\alpha$. That is, if you have to make a decision rule based on p-value. – StubbornAtom Dec 2 '18 at 11:06

The test will reject $$H_0$$ for sufficiently large values of the ratio

\begin{align*} \frac{2}{\Gamma\left(\frac{1}{4}\right)}\frac{\text{exp}\left(-x^4\right)}{\frac{1}{\sqrt{2\pi}}\text{exp}\left(-\frac{x^2}{2}\right)} &=\frac{2\sqrt{2\pi}}{\Gamma\left(\frac{1}{4}\right)}\text{exp}\left(-x^4+\frac{1}{2}x^2\right)\\\\ &=\frac{2\sqrt{2\pi}}{\Gamma\left(\frac{1}{4}\right)}e^{\frac{1}{16}}\text{exp}\left(-x^4+\frac{1}{2}x^2-\frac{1}{16}\right)\\\\ &=c\cdot\text{exp}\left(-\left[x^2-\frac{1}{4}\right]^2\right) \end{align*}

where $$c$$ is a positive constant. For the observed value of $$x$$, this ratio equals

$$c\cdot\text{exp}\left(-\left[0.6^2-\frac{1}{4}\right]^2\right)=c\cdot\text{exp}(-0.0121)$$

The desired p-value is the probability, when $$H_0$$ is true, that $$X$$ assumes any value $$x$$ such that $$c\cdot\text{exp}\left(-\left[x^2-\frac{1}{4}\right]^2\right)\geq c\cdot\text{exp}(-0.0121)$$

Such values of $$x$$ satisfy

$$\left[x^2-\frac{1}{4}\right]^2\leq 0.0121\Rightarrow\left|x^2-\frac{1}{4}\right|\leq0.11$$

Hence $$-0.11\leq x^2-\frac{1}{4}\leq0.11\Rightarrow 0.14\leq x^2 \leq 0.36$$

Then $$\sqrt{0.14}\leq x \leq 0.6 \text{ or } -0.6\leq x \leq -\sqrt{0.14}$$

Because the standard normal pdf is symmetric about $$0$$, the desired p-value is

$$2\left[\Phi(0.6)-\Phi(\sqrt{0.14})\right]=0.16$$