# MLE of $\theta$ from $N(\theta+2, \theta^2)$

Let $$X_1, X_2, ..., X_n$$ be a random sample from $$N(\theta+2, \theta^2)$$. Find the MLE of $$\theta$$.

I went through some work and I could not solve for $$\theta$$. Am I doing anything wrong?

$$L( \theta )= \prod _ { i = 1 } ^ { n } \frac { 1 } { \theta \sqrt { 2 \pi } } \exp \bigg[- \frac{( x _ { i } - \theta - 2 )^2}{2 \theta ^ { 2 }} \bigg] = \bigg( \frac {1 } { \theta\sqrt { 2 \pi } } \bigg )^n \exp \bigg [ - \frac { \sum _ { i = 1 } ^ { n } ( x _ { i } - \theta - 2 ) ^ { 2 } } { 2 \theta ^ { 2 } }\bigg ]$$

$$\ln [ L( \theta ) ] = - n \ln ( \theta \sqrt { 2 \pi } ) - \frac { \sum _ { i= 1 } ^ { n } ( x _ { i } - \theta - 2 ) ^ { 2 } } { 2 \theta ^ { 2 } }$$

$$\frac { d \ln [ L ( \theta ) ] } { d \theta } = - \frac { n } { \theta } - \frac{2 ( - 1 ) ( 2 \theta ^ { 2 } ) \sum _ { i = 1 } ^ { n } ( x _ { i } - \theta - 2 ) - 4 \theta \sum _ { i = 1 } ^ { n } ( x _ { i } - \theta - 2 ) ^ { 2 }}{4\theta ^4}$$

$$0 = \theta \sum _ { i = 1 } ^ { n } ( x _ { i } - \theta - 2 ) + \sum _ { i = 1 } ^ { n } ( x _ { i } - \theta - 2 ) ^ { 2 } - n \theta ^ { 2 }$$

• There are different reasons why links to pictures aren’t great. Please use MathJax.
– Aig
Commented Mar 22 at 9:31
• @Aig Question is updated. Thank you for reminding me. Commented Mar 22 at 9:41
• It looks good so far. Now you have a quadratic equation for $\theta$ that you can solve. Commented Mar 22 at 10:22
• What you got is a quadratic equation on $\theta$, $\theta\sum (x_i-2) -n\theta^2+\sum (x_i-2)^2+n\theta^2-2\theta\sum_i (x_i-2)-n\theta^2=0$. Are you sure you cannot solve it? Commented Apr 15 at 8:02
• Related question: stats.stackexchange.com/q/369417/399354
– Amir
Commented Apr 22 at 16:49

$$\underbrace{-n}_{a} {\theta}^{2} \underbrace{-\sum_{i} \left( {x}_{i} - 2 \right)}_{b} \theta \underbrace{-\sum_{i} {\left( {x}_{i} - 2 \right)}^{2}}_{c} = 0$$
Which you may use to find the roots by a closed form formula (It will be stable as $$b \geq 4 a c$$ is guaranteed).
The full code is available on my StackExchange Mathematics GitHub Repository (Look at the Mathematics\Q4885452 folder).