I've been trying to teach myself some of the fundamentals of statistics by trying to work through old qualifying exams. Here's a problem:
Suppose $X_1, \ldots, X_n$ are a random sample from a normal distribution with mean $\theta$ and variance $\sigma^2$, where $\sigma^2$ is fixed and $\theta>0$ is a parameter. Find the maximum likelihood estimator of $\sqrt{\theta}$.
My work so far:
I have the likelihood function $$L(\theta|\mathbf{x})=(2\pi \sigma^2)^{-n/2} \text{exp}\Big(-\frac{1}{2\sigma^2}\sum_{i=1}^{n}(x_i-\theta) \Big).$$
Then, differentiating $L(\theta|\mathbf{x})$ with respect to theta, and equating the result to zero yields $$\sum_{i=1}^{n}(x_i-\theta)=0 \implies \theta=\frac{1}{n}\sum_{i=1}^{n}x_i \hspace{3mm} (=\bar{x}).$$ The second derivative is negative here, hence the MLE of $\theta$ is $\hat{\theta}=\bar{X}$. So, by the invariance property of MLEs, the MLE of $\sqrt{\theta}$ is $\sqrt{\hat{\theta}}=\sqrt{\bar{X}}.$
Question:
My question is about the $\theta>0$ assumption (I'm pretty sure $\sqrt{\bar{X}}$ would be fine if there were no restrictions on $\theta$). So, for $\theta>0$, would the MLE for $\theta$ be something like $\max\{\bar{X},0\}$?
I would greatly appreciate any feedback, corrections, etc.