# Maximum Likelihood Estimators - Calculation Question

Let $Y_t = \mu X_t + (\sigma^2)^{1/2}Z_t$, where the sequence $(Z_t)_{t \in \mathbb{N}}$ are iid standard normals, i.e. $Z_t \sim \mathcal{N}(0,1)$, and $(X_t)_{t \in \mathbb{N}}$ is a non-random (observed) sequence. I would like to find the maximum likelihood estimators for $\mu$ and $\sigma^2$.

We have $$\mathcal{L}_n(\mu, \sigma^2) = \prod_{i=1}^n \left(\mu X_i + \frac{(\sigma^2)^{1/2}}{\sqrt{2\pi}}e^{-\frac{z_i^2}{2}}\right),$$ since the pdf of $Z_t$ is $f(z) = \frac{1}{\sqrt{2\pi}}e^{-z^2/2}$.

Then \begin{align*} \ell_n(\mu, \sigma^2) &= \text{log}\mathcal{L}_n(\mu, \sigma^2) \\ &= \sum_{i=1}^n \left(\text{log}(\mu X_i) - \frac{z_i^2}{2}\text{log}\left(\frac{(\sigma^2)^{1/2}}{\sqrt{2\pi}}\right)\right) \\ &= \sum_{i=1}^n \text{log}(\mu X_i) - \frac{1}{2}\text{log}\left(\frac{(\sigma^2)^{1/2}}{\sqrt{2\pi}}\right)\sum_{i=1}^n z_i^2 \end{align*}

Taking the derivatives, setting to $0$, and solving for each parameter yields

$$\frac{d}{d\mu}\ell_n(\mu,\sigma^2) = \sum_{i=1}^n \left(\frac{1}{\mu X_i} \cdot X_i\right) = \frac{n}{\mu} = 0 \Longrightarrow \hat{\mu}_{\text{ML}} = 0$$

and

$$\frac{d}{d\sigma^2}\ell_n(\mu,\sigma^2) = \left(-\frac{\sqrt{2\pi}}{4\sqrt{2\pi}(\sigma^2)^{1/2}(\sigma^2)^{1/2}}\right)\sum_{i=1}^n z_i^2 = -\frac{1}{4\sigma^2}\sum_{i=1}^n z_i^2 = 0 \Longrightarrow \hat{\sigma}^2_{\text{ML}} = 0.$$

I believe I am making a mistake somewhere in the computation, especially since $\hat{\sigma}^2_{\text{ML}} = 0$. However, I am having a tough time finding where I am going wrong.

I believe there is a problem with the first equation. If by likelihood, we compute $p(y|x)=\prod_{i=1}^n p(y_i|x_i)$, then each of these components are Gaussian with density of the form $N(\mu x_i, \sigma^2)$. Hence,
$p(y|x) = \prod_{i=1}^n \dfrac{1}{\sigma\sqrt{2\pi}} e^{-\dfrac{(y_i-\mu x_i)^2}{2\sigma^2}}$