# Finding minimum value of observation for a given power in hypothesis testing.

Mathematics Asked by Hachiman Hikigaya on December 8, 2020

Let $$X_{1}, ldots, X_{n}$$ be a sample from the distribution $$mathrm{N}(mu, 1)$$ and consider testing $$H_{0}: mu=mu_{0}$$ versus $$H_{1}: mu=mu_{1}$$ where $$mu_{0} are known numbers.
(a) For a given level $$alpha,$$ find the most powerful test.
(b) Calculate the power
(c) For given $$mu_{0}, mu_{1}, alpha,$$ determine the minimal number of observations needed to have power at least $$beta$$ (i.e., to reject $$H_{0}$$ with probability at least $$beta$$ when $$H_{1}$$ holds).

Using Neyman Pearson lemma I have found the test statistic to be $$bar X$$ and reject $$H_{0}$$ if $$bar X > k$$, where $$k= z_alpha / sqrt{n} + mu_0$$ .

And calculated the power to be Power = P{Reject $$H_0$$} = P{$$Z> z_alpha – sqrt{n} (mu-mu_0)$$}

But for the Part (c) I don’t know how to find the minimum number of observation for given condition.
I think I have to solve the equation $$beta = P_{mu_1}{bar X > z_alpha / sqrt{n} + mu_0 }$$ = P{$$Z> z_alpha – sqrt{n} (mu_1-mu_0)$$}
But I don’t know how to solve this for $$n$$.

You can state it in terms of the CDF $$Phi(z)=P(Z le z)$$; I don't think there is a way to avoid it.

begin{align} beta &le 1 - Phi(z_alpha - sqrt{n}(mu_1-mu_0)) \ Phi^{-1}(1-beta) &ge z_alpha - sqrt{n} (mu_1 - mu_0) \ sqrt{n} &ge frac{z_alpha - Phi^{-1}(1-beta)}{mu_1 - mu_0} end{align}

Answered by angryavian on December 8, 2020

As you found, UMP test is given by Neyman Pearson's Lemma with rejection region

$$mathbb {P}[overline{X}_n>k|mu=mu_0]=alpha$$

Now $$overline{X}_n>k$$ is your decision rule ($$k$$ now is fixed) and you can calculate the power ( usually indicated with $$gamma$$ because $$beta$$ is normally used for type II error)

$$mathbb {P}[overline{X}_n>k|mu=mu_1]=gamma$$

Understood this, finally fix $$gamma$$ and get $$n$$

Example

$$mu_0=5$$

$$mu_1=6$$

$$alpha=5%$$

$$n=4$$

The critical region is

$$(overline {X}_4-5)2=1.64rightarrow overline {X}_4=5.8224$$

$$overline {X}_4geq 5.8224$$

and you can calculate the power

$$gamma=mathbb {P}[overline {X}_4geq 5.8224|mu=6]=1-Phi(-0.36)approx 64%$$

Now suppose you want a fixed power $$gamma geq 90%$$, simply re-solve the same inequality in $$n$$

$$mathbb {P}[overline {X}_ngeq 5.82|mu=6]geq 0.90$$

Getting

$$(5.8224-6)sqrt{n}leq-1.2816$$

That is

$$ngeqBigg lceil Bigg(frac{1.2816}{0.1776}Bigg)^2Biggrceil=53$$

Answered by tommik on December 8, 2020

## Related Questions

### Action of the $n$-th roots of unity on $mathbb{A}^2$

1  Asked on November 19, 2021

### MIN-FORMULA $in$ NP

1  Asked on November 19, 2021 by ettore

### $forall xinmathbb{R}enspace enspace, forall yinmathbb{R} : (xge y)$ or $(xle y)$ proof?

1  Asked on November 19, 2021

### Interchange of diagonal elements with unitary transformation

2  Asked on November 19, 2021

### How can we prove mgf of sample proportion of binomial distribution converges to exp(pt)?

1  Asked on November 19, 2021

### What is the difference between a measure being “supported on [set] $A$” vs “supported in $A$” vs “supported at $A$”?

0  Asked on November 18, 2021

### Is taking the derivative inside this integral acceptable?

1  Asked on November 18, 2021

### Moduli Space of Tori

1  Asked on November 18, 2021 by bookworm

### Necessary condition for x>0 being an integer

2  Asked on November 18, 2021 by aeternal

### Does the Null spaces of matrix $ntimes n$ matrix $A$ and matrix $BA$ equal to each other if the matrix $B$ is invertible?

1  Asked on November 18, 2021

### Given a basis $mathcal{B}$, can I assume that $mathcal{B}$ is orthonormal?

3  Asked on November 18, 2021

### Hausdorff and non-discrete topology on $mathbb{Z}$

3  Asked on November 18, 2021 by uday-patel

### Rearrangement diverges then original series also diverges?

2  Asked on November 18, 2021 by akash-patalwanshi

### Absolutely continuous function with bounded derivative on an open interval is Lipschitz

2  Asked on November 18, 2021

### Under what condition on $A$ is the following true: $lambda_{min}(A) |x|_2^2 leq x^T Ax leq lambda_{max}(A) |x|_2^2$?

1  Asked on November 18, 2021

### Convergence in L2 (up to a constant) implies convergence in probability?

1  Asked on November 18, 2021 by user3294195

### Find the constant for $int_{0}^{1} {frac{mathrm{d}x}{sqrt{(1-x^2)(1-(kx)^4)}}} sim Cln(1-k)$

1  Asked on November 18, 2021 by nanayajitzuki

### Prove $lim_{nmapsto 0}[(psi(n)+gamma)psi^{(1)}(n)-frac12psi^{(2)}(n)]=2zeta(3)$

2  Asked on November 18, 2021

### Prove or disprove that If $amid c$ and $bmid c$, then $ab mid c$.

1  Asked on November 18, 2021 by mathyviking

### Question on Vectors and Linear equation

1  Asked on November 18, 2021