Consider a random sample of size $n$ from a discrete uniform distribution with pmf $f(x|N) = 1/N$, where $x=1,\dots,N$. Determine the likelihood ratio test for testing $H_0: N \leq N_0$, $H_1: N > N_0$.

I found the likelihood function is $1/N^n$. The maximum will be at $N=1$. So I believe the likelihood test will be $\Lambda = 1$. Is this correct - if so, what does this mean? It seems that we always will fail to reject $H_0$, which isn't really much of a test is it?

  • $\begingroup$ Normally the likelihood ratio test would test the null hypothesis the the distribution is discrete uniform with N known and fixed versus an alternative that the distribution is some specific nonuniform discrete distribution. x would be the random variable and you would have a sequence of n independent xs all with the same discrete distribution on 1, 2, 3,...,N. Under the null hypothesis the likelihood would be $1/N^n$, But what sort of test are you doing ? Are you taking N to be random too? $\endgroup$ Commented May 6, 2018 at 4:04
  • 2
    $\begingroup$ If you see $x_1=3$ (say), can $N$ actually be $1$? See this related question on MLE, which discusses likelihood for this case. $\endgroup$
    – Glen_b
    Commented May 6, 2018 at 4:55

1 Answer 1


The likelihood ratio test (LRT) statistic does not always equal $1$.

Likelihood function given the sample $x=(x_1,\ldots,x_n)\in\{1,2,\ldots,N\}$ is $$L(N\mid x)=\frac{1}{N^n}I_{\{x_{(n)},x_{(n)}+1,\ldots\}}(N)\quad,\,N\in\{1,2,\ldots\}$$

Here $x_{(n)}=\max\{x_1,x_2,\ldots,x_n\}$ is the maximum order statistic as usual.

So the LRT statistic is

\begin{align} \Lambda(x)&=\frac{\sup_{N\le N_0}L(N\mid x)}{\sup_N L(N\mid x)} \\&=\frac{L(\tilde N\mid x)}{L(\hat N\mid x)}\,\,, \end{align}

where $\hat N=x_{(n)}$ is the (unrestricted) MLE of $N$ and $\tilde N=\min(\hat N,N_0)$ is the restricted MLE of $N$ when $N\le N_0$. Therefore the ratio is

$$\Lambda(x)=\begin{cases}1&,\text{ if }x_{(n)}\le N_0 \\ \frac{L(N_0\mid x)}{L(x_{(n)}\mid x)}&,\text{ if }x_{(n)}>N_0\end{cases}$$

That is,

$$\Lambda(x)=\begin{cases}1&,\text{ if }x_{(n)}\le N_0 \\ 0&,\text{ if }x_{(n)}>N_0\end{cases}$$

$H_0$ is trivially accepted when $\Lambda=1$. We reject $H_0$ for small values of $\Lambda$.

So a level $\alpha$ likelihood ratio test rejects $H_0$ if $X_{(n)}>N_0$.

The above test has size $0$. If you want the test to attain exact size $\alpha$, use the randomized test $$\phi(x)=\begin{cases}1&,\text{ if }x_{(n)}>N_0 \\ \alpha &, \text{ if }x_{(n)}\le N_0\end{cases}$$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.