# UMP test for a distribution and calculating alpha

My $f(x) = \theta x ^{ (\theta -1)}$ for $0 < x < 1$ and $\theta > 0$.

I found that the UMP to test $H_0: \theta = 1 \mbox{ vs } H_a: \theta = \theta_a$ is $\sum(ln(x_i)) \geq c$. I have a total of n= 50.

Now I want to find the c for which I get a type 1 error rate of .05. Thus I want:

$Pr(\sum ln(x_i) >= c | \theta = 1) = .05$

I observe that $- ln(X) \sim exponential (\theta)$ and thus $- \sum(log(X_i)) \sim \Gamma(n, \theta)$

Now I know that $Pr(G < 38.96473) = .05$ if $G \sim \Gamma(n = 50, shape =1)$

But solving I get:

$Pr(\sum ln(x_i) \geq c) = .05 \Rightarrow Pr( - \sum ln(x_i) \leq -c) = .05 \Rightarrow Pr( G \leq 38.96473) = 0.05$

But does that make my c = -38.96473 from my region above?

Yes, you have the right $c$, but there's some confusion on a few things.
If you are defining $G = -\sum_i \ln(X_i)$, then either $$G \sim \text{Gamma}(n, \theta)$$ where $\theta$ is the rate parameter or $$G \sim \text{Gamma}(n, \theta^{-1})$$ where $\theta^{-1}$ is the scale parameter.
Also, in this particular case, $\theta=1$ under the null hypothesis, so for this particular example, you don't get docked for the confusion. Either of these will work in R:
qgamma(.05,shape=50,rate=1)