Pi Product finding maximum help

47 Views Asked by At

Trying to find the critical number for this ln of a pi product. I tried takin the partial derivative of the inner function it turn out a little messy and I'm unsure what how to get all the way to the critical number.

Let $\ell(\vec{x}:\mu, \sigma) = \ln\left(\prod_{k=1}^{n} \frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(x_k-\mu)^2}{2\sigma^2}\right)\right)$. Treating the values of $\vec{x} = [x_1, x_2, ..., x_n]$ as constants, at what value of $\mu$, $\sigma$ does $\ell(\vec{x}:\mu, \sigma)$ have a maximum?

Here is my what I have as the derivative.

$\frac{\partial \:}{\partial \:s}\left(\frac{1}{\sqrt{2\pi s^2}}e^{-\frac{\left(x_k-u\left(s,\:x\right)\right)^2}{2s^2}}\right)=\frac{e^{-\frac{\left(x_k-u\left(s,\:x\right)\right)^2}{2s^2}}\left(-s^2+\left(x_k-u\left(s,\:x\right)\right)\left(s\frac{\partial \:}{\partial \:s}\left(u\left(s,\:x\right)\right)+x_k-u\left(s,\:x\right)\right)\right)}{2^{\frac{1}{2}}\pi ^{\frac{1}{2}}s\left(s^2\right)^{\frac{3}{2}}}$

How to do get the maximum of $\: \ell(\vec{x}:\mu, \sigma)$

1

There are 1 best solutions below

0
On

First, using the properties of log, write the expression as \begin{align}\ell(\vec{x}:\mu, \sigma) &= \sum_{k=1}^n \log\left(\frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(-\frac{(x_k-\mu)^2}{2\sigma^2}\right)\right) \\ &= \sum_{k=1}^n \log\left((2\pi\sigma^2)^{-\frac12}\right)+\sum_{k=1}^n \log\left(\exp\left(-\frac{(x_k-\mu)^2}{2\sigma^2}\right)\right) \\ &=-\frac{n}{2}\log(2\pi)-\frac{n}{2}\log(\sigma^2)-\frac{1}{2\sigma^2}\sum_{k=1}^n (x_k-\mu)^2\end{align}

Differentiating w.r.t. $\mu$ gives $$\frac{\partial \ell}{\partial \mu}=\frac{1}{\sigma^2}\sum_{k=1}^n(x_k-\mu)$$ and setting equal to zero yields $\mu=\frac{1}{n}\sum_{k=1}^n x_k=\bar{x}$ at the maximum. Differentiating w.r.t. $\sigma^2$ gives $$\frac{\partial \ell}{\partial \sigma^2}=-\frac{n}{2\sigma^2}+\frac{1}{2\sigma^4}\sum_{k=1}^n (x_k-\mu)^2.$$ Setting equal to zero shows that $\sigma^2=\frac1n \sum_{k=1}^n (x_k-\mu)^2$ at the maximum.

So $\ell$ has attains its maximum at $\mu=\bar{x}$ and $\sigma^2=\frac1n \sum_{k=1}^n (x_k-\bar{x})^2=S_{XX}/n$.