# how can I find maximum value of this function?

Can any one help me to calculate this function : $$f(y)=\max\limits_{\mu>0}[\exp(\frac{-n\mu^{2}}{\sigma^{2}})\exp(\frac{2\mu}{\sigma^{2}}\sum_{k=1}^{n}y_{k})]$$ where $y_{k}$ is random variable with normal distribution.  Thank you in advance.

Sorry, I had forgotten to put the second power of $\mu$ in first exponential(I modified it).

-
0.0333325355322 – l--''''''---------'''''''''''' Nov 12 '12 at 19:18

To maximize $\exp(g(\mu)/\sigma^2)$ with $g(\mu)=-n\mu^2+2\mu s$ and $s=\sum\limits_{k=1}^ny_k$, one should maximise $g(\mu)$. Since $g'(\mu)=-2n\mu+2s$ is positive for $\mu\lt s/n$ and negative for $\mu\gt s/n$, $g(\mu)$ is maximal at $\mu=s/n$ and $f(y)=\exp(g(s/n)/\sigma^2)$. Since $g(s/n)=s^2/n$, $f(y)=\exp(s^2/(n\sigma^2))$.
If $S = \sum_{k=1}^n y_k$, you want to maximize $g(\mu) = \exp((2S - n)\mu/\sigma^2)$ over $\mu > 0$. Presumably $\sigma^2 > 0$. If $2S-n > 0$ the supremum is $+\infty$: $g(\mu) \to +\infty$ as $\mu \to +\infty$. If $2S-n = 0$, $g(\mu) = 1$ for all $\mu$. If $2S-n < 0$ the supremum is $1$, with $g(\mu) < 1$ for $\mu > 0$ and $g(\mu) \to 1$ as $\mu \to 1$.
My main question is that whether the supremum depends on $\mu$ or not? – sendra Nov 12 '12 at 18:54
How can the $\sup$ over $\mu$ depend on $\mu$? Taking the $\sup$ over $\mu$ must remove functional dependence on $\mu$. – copper.hat Nov 12 '12 at 19:26