# Failing to obtain $\chi^2(1)$ asymptotic distribution under $H_0$ in a likelihood ratio test: example 2

I have a large sample (a vector) $$\mathbf{x}$$ from a random variable $$X\sim N(\mu,\sigma^2)$$. The variance $$\sigma^2$$ is known, but the expectation $$\mu$$ is unknown. I would like to test the null hypothesis $$H_0\colon \ \mu\leq 0$$ against the alternative $$H_1\colon \ \mu>0$$ using a likelihood ratio (LR) test. The test statistic is $$\text{LR}=-2\ln\frac{L(\mathbf{x}\mid\tilde\mu,\sigma^2)}{L(\mathbf{x}\mid\hat\mu,\sigma^2)}.$$ where $$\tilde\mu$$ is the estimate of $$\mu$$ under $$H_0$$ (thus $$\tilde\mu\leq 0$$) and $$\hat\mu$$ is the estimate of $$\mu$$ under $$H_0 \cup H_1$$ (thus $$\hat\mu\in R$$).

I expected the asymptotic distribution of $$\text{LR}$$ under $$H_0$$ to be $$\chi^2(1)$$ but I am getting only zeros in a simulation below.

Questions: Why is that? Is my simulation wrong? Or is the test statistic not supposed to have the $$\chi^2(1)$$ asymptotic distribution under $$H_0$$, and if so, why?

n=1e3   # sample size
sigma=1 # standard deviation of X
m=3e3   # number of simulation runs
mu=-1   # particular instance of the null hypothesis used in the simulation

logL0s=logL1s=logLRs=rep(NA,m)
for(i in 1:m){
set.seed(i); x=rnorm(m,mean=mu,sd=sigma)
logL0=sum(log( dnorm(x,mean=min(0,mean(x)),sd=sigma) ))
logL1=sum(log( dnorm(x,mean=max(0,mean(x)),sd=sigma) ))
logLR =-2*(logL0-max(logL0,logL1)) # the -2*ln(LR) statistic from this simulation run
logL0s[i]=logL0; logL1s[i]=logL1; logLRs[i]=logLR
}

summary(logLRs)
• Can you please edit your question to put the links to related questions in the body of the question? If a discussion with various upvoted comments ensues, then your initial comment may be hidden later on. Jan 27, 2021 at 16:33
• I won't say that I know more than you :), but I'd say that if you as the OP know about related questions, I think you should just put them in the body of your question - after all, they are related to it. Jan 27, 2021 at 16:37

The LR doesn't have a $$\chi^2_1$$ distribution for this test.
The basic setting where there's a $$\chi^2_1$$ null distribution is when the null hypothesis is a subspace of the alternative hypothesis, with one less dimension. A key part of the setup is that every point in the null has points in the alternative at arbitrarily small distances away.
• It's usually thought of as part of the question, not as a regularity condition. That is, those lists are regularity conditions for testing the null hypothesis $\theta=\theta_0$ (or perhaps $(\theta,\eta)=(\theta_0,eta)$ when there are other parameters. For example, the second comment on that linked answer specifies it's a test of $\theta=\theta_0$. Jan 28, 2021 at 2:23