# Finding the Derivative of an Expected Value.

Is it possible to find the derivative of an expression inside the expectation operator $\mathbb{E}[\cdot]$? I have an expression that reads $$\mathbb{E} \left[ \left[ \log(A_{k}) - \log(\hat{A_{k}}) \right]^{2} ~ \Bigg| ~ (y_{t})_{0 \leq t \leq T} \right]\cdots \cdots \cdots (1)$$ which needs to be minimised.
Then it says: The estimator is easily shown to be $$\hat{A_{k}} = \exp \left( \mathbb{E} \left[ \log(A_{k}) ~ \Big| ~ (y_{t})_{0 \leq t \leq T} \right] \right)\cdots \cdots \cdots (2)$$ How can this be shown? Thanks!

--------EDIT--------
I have one more question
The equations said that the log in equation 2 is natural log (ln) while it is independent of the log base used in equation 1. Could you please tell me the reason for that?
Thank you very much

--------EDIT 2--------
Something related: Expected value and Variance

-
Dear user13267, I’ve done some major editing to your question in order to make the presentation clearer. – Haskell Curry Feb 19 '13 at 8:02
@Haskell Curry: Thank you very much. I greatly appreciate your time and effort. – user13267 Feb 19 '13 at 8:09
Do not edit the question long after you received answer(s). – Did Feb 20 '13 at 6:54

One is looking for the value $a$ which yields the minimal $$L(a)=\mathbb E((\log A_k-\log a)^2\mid y_t,t\leqslant T).$$ This assumes that $(\log A_k)^2$ is integrable, otherwise the function $L$ would be infinite everywhere. In such a context Lebesgue differentiation theorem indicates that indeed, $$\frac{\mathrm d}{\mathrm da}\mathbb E(G(A_k,a))=\mathbb E\left(\frac{\partial}{\partial a}G(A_k,a)\right).$$ Here, $$L'(a)=-\frac2{a}\mathbb E(\log A_k-\log a\mid y_t,t\leqslant T)=-\frac2{a}\left(\mathbb E(\log A_k\mid y_t,t\leqslant T)-\log a\right),$$ hence $L'(a)=0$ if and only if $$\log a=\mathbb E(\log A_k\mid y_t,t\leqslant T),$$ that is, $$a=\exp\left(\mathbb E(\log A_k\mid y_t,t\leqslant T)\right).$$ Edit: The reasoning above applies to every (differentiable) function $L$. In the present case, one can note that $a\mapsto L(a)$ is a quadratic polynomial in $\log a$, namely, $$L(a)=\mathbb E((\log A_k)^2\mid y_t,t\leqslant T)-2\mathbb E(\log A_k\mid y_t,t\leqslant T)(\log a)+(\log a)^2.$$ Since the polynomial $x\mapsto\gamma-2\beta x+x^2$ is minimal when $x=\beta$, the likelihood $a\mapsto L(a)$ is minimal when $\log a=\mathbb E(\log A_k\mid y_t,t\leqslant T)$.
See Edit.   – Did Feb 19 '13 at 7:53
First question: $\gamma-2\beta x+x^2=\gamma-\beta^2+(\beta-x)^2$. Second question: ANY expression? Well, derivative zero, if you can. – Did Feb 19 '13 at 8:05