Likelihood ratio test to determine if average number of accidents has dropped? I can't find any worked (non-trivial) practical example for a likelihood ratio test, believe me I have spent hours looking. Here is a question I've been trying to complete but I can't get any further. Can anyone show me how to complete this, and also tell if I am on the right track with the work I have done?
Question
The average time between accidents on a road is 4 days. This year a random sample of accidents showed that the time between accidents was 2, 3, 6, 1 days. Is there evidence that the number of accidents has dropped on average? Use a likelihood ratio test.
Attempt
Our hypotheses are
$H_0: \lambda = 4$ 
$H_1: \lambda < 4$
Where $\lambda$ is the population mean time between accidents
Our likelihood ratio test is
$$\phi = \frac{\sup_{\lambda \in \Omega_{H_{0}}}L(\lambda | \underline x)}{\sup_{\lambda \in \Omega}L(\theta|\underline x)}$$
Now, $L(\lambda|\underline x) = \prod_{i=1}^4 f(x_i|\lambda)$
$= \lambda^n e^{-\lambda \sum_{i=1}^n x_i}$
$= \lambda^n e^{-\lambda n \overline{x}}$
So we have -
$$\phi = \frac{\sup_{\lambda\in \Omega_{H_{0}}}\lambda^n e^{-\lambda n \overline{x}}}{\sup_{\lambda\in \Omega}\lambda^n e^{-\lambda n \overline{x}}}$$
We only have one choice for $\lambda$ in $H_0$ (although I'm not sure if I should be using $4$ or $\frac{1}{4}$ for $\lambda$) and $n=4$ giving us
$$= \frac{4^4 e^{-4 * 4 * \overline{x}}}{\sup_{\lambda\in \Omega}\lambda^4 e^{-\lambda 4 \overline{x}}}$$
$$= \frac{256 e^{-16 \overline{x}}}{\sup_{\lambda\in \Omega}\lambda^4 e^{-\lambda 4 \overline{x}}}$$
I'm not sure what to do now. How do I deal with the sup in the denominator? Can I sub in $3$ for the $\overline x$'s due to the random observations of $2, 3, 6$ and $1$? Has my work up to this point been correct?
 A: Two things:

*

*Your hypothesis test uses the scale parameterisation of the Exponential distribution ("Where $\lambda$ is the population mean time between accidents$), whereas your answer uses the rate parameterisation. The correct likelihood is

$$ L(\lambda;\underline{x}) = \prod_{i=1}^n f_{X_i}(x_i;\lambda) =  
\prod_{i=1}^n \frac{1}{\lambda}e^{-x_i/\lambda} =  
\lambda^{-n} e^{-n\bar{x}/\lambda}  
$$


*The likelihood-ratio test is suitable when we're testing hypotheses of the form $H_0: \, \theta \in \Theta_0$ versus $H_1: \, \theta \in \Theta_0^c$, the complement of $\Theta_0$. In your example, if we want $H_1: \, \lambda < 4$, then we have to take $H_0: \, \lambda \geq 4$.

I posted a more detailed answer here: Likelihood ratio test for composite alternative hypothesis
A: In terms of finding sup, think of it as finding maximum of that equation, $\lambda^{4}e^{-\lambda 4\bar{x}}$. Well recall that the MLE for an estimator is the value that maximizes the likelihood function, and the MLE for $\lambda=\bar{x}$ so we have $\sup_{\lambda \in\Omega}\lambda^{4}e^{-\lambda 4\bar{x}}=\bar{x}^{4}e^{-\bar{x}(4\bar{x})}$ Through manipulations you should get that test where we reject $H_{o}$ iff $\bar{x}\leq c$ for some $c$ that corresponds to the significance level you want (after looking at this it may be easier to have $\sum_{i=1}^{4}x_{i}\leq c$ since you can find distribution of $\sum_{i=1}^{4}X_{i}$ where $X_{i}\sim Exp(4)$)
In order to help you out I will go through the whole derivation because even when I did these types of questions at first they get quite messy. So we know the likelihood ration test has form 
$$\Lambda(x)< c$$ where c corresponds to the significance level you want and $\Lambda(x)$ is the likelihood ratio statistic given by 
$$\Lambda(x)=\frac{\sup_{\lambda\in\Theta_{H_{o}}}L(\lambda|x)}{\sup_{\lambda\in\Theta}L(\lambda|x)}=\frac{L(4|x)}{L(\bar{x}|x)}$$
where we get denominator since maximum likelihood estimator for $\lambda$ (i.e. the number that maximizes the likelihood function thus at that point will be supremum). Now the likelihood function we have is 
$$L(\lambda|x)=\lambda^{n}e^{-\lambda\sum x_{i}}=\lambda^{n}e^{-\lambda(n\bar{x})}$$  thus we have 
$$\Lambda(x)=\frac{4^{n}e^{-4(n\bar{x})}}{\bar{x}^{n}e^{-\bar{x}(n\bar{x})}}$$ thus for likelhood ratio test we have these equivalent inequalities 
$$\frac{4^{n}e^{-4(n\bar{x})}}{\bar{x}^{n}e^{-\bar{x}(n\bar{x})}}< c_{1}$$
$$\frac{e^{-4(n\bar{x})}}{e^{-\bar{x}(n\bar{x})}}< c_{2}\rightarrow e^{n\bar{x}(-4+\bar{x})}< c_{2}$$
by taking $\ln$ of both sides we have (since increasing function maintains order i.e. direction of sign remains the same)
$$n\bar{x}(-4+\bar{x})< c_{3}$$
$$n\bar{x}< c_{4}\rightarrow \sum x<c_{4}$$
(NOTE: the different $c_{i}$'s I have is just me doing algebra operations to both sides like dividing and subtracting constants)
Thus finally the maximum likelihood ratio test is equivalent to 
$$\textrm{Reject Null iff }\sum x< c$$
for $c$ that corresponds to significance level for distribution of $\sum x$ (hint: what is distribution of sum of iid $Exp(4)$ rvs?)
Also when you want questions like these answered it may be better to ask math stack exchange because user there can answer more derivation like these. cross validated is excellent for questions on methods and applications of statistics 
A: The likelihood ratio test implies that we are considering two hypotheses with one nested inside the other (in order that the test statistic follows an approximate chi-squared distribution).
The null hypotheses Ho is (presumably) exponential with mean 4. The alternate hypothesis has mean of 3. The 3 is the maximum likelihood estimate of the exponential parameter from the data which in this case is just the mean. 
Plugging these values into the likelihood function and calculating 2 * difference in negative log-likelihood gives the test statistic. This can be compared against chi-squared distribution with 1 degree of freedom (due to one parameter estimated from the data).
