I am trying to obtain the variance of a function of two random variables

$$f(\boldsymbol x):= x_A (e^{k(x_A+x_B)}-1)$$

where $\boldsymbol x = [x_A, x_B]^T$. Additionally, I know that $\operatorname{E}[x_A]=\operatorname{E}[x_B]=0$.

My approach is to obtain:

$$\operatorname{Var}[f] = \operatorname{E}[f^2]-\operatorname{E}[f]^2$$

For the expectation of $f$, I followed this post and used

$$ \operatorname{E}[f(\boldsymbol x)] \approx f(\operatorname{E}[\boldsymbol x]) + \frac{1}{2} \operatorname{E}[(\boldsymbol x-\operatorname{E}[\boldsymbol x])^TH_f(\operatorname{E}[\boldsymbol x]) (\boldsymbol x-\operatorname{E}[\boldsymbol x])] $$

Which for this case should simplify to

$$ \operatorname{E}[f(\boldsymbol x)] \approx \frac{1}{2} \operatorname{E}[(\boldsymbol x)^TH_f(\operatorname{E}[\boldsymbol x]) \boldsymbol x] $$

The hessian matrix for $f(\boldsymbol x)$ evaluated at $\operatorname{E}[\boldsymbol x]=[0,0]^T$ turns to be

$$ H_f(\operatorname{E}[[0,0]^T]) =\left[ \begin{matrix} 2k & k \\ k& 0 \end{matrix}\right] $$

so I get

$$\operatorname{E}[f(\boldsymbol x)] \approx \operatorname{E}\left[[x_A, x_B]\left[ \begin{matrix} 2k & k \\ k& 0 \end{matrix}\right] [x_A, x_B]^T\right]= \operatorname{E}[kx_A^2+kx_Ax_B]$$

For $\operatorname{E}[f^2]$, every term in the hessian (evaluated at $\operatorname{E}[\boldsymbol x]$) is null. Because of this I get $\operatorname{E}[f^2]\approx 0$.

Then, as $(\operatorname{E}[kx_A^2+kx_Ax_B])^2\ge 0$, my estimation of the variance is negative.

My questions are:

  • What I am doing wrong?
  • How to solve it correctly?

Thank you very much

  • $\begingroup$ What distribution has the property of $\operatorname{E}[f^2]\approx 0$ ? $\endgroup$
    – user158565
    Jan 4, 2019 at 2:12
  • $\begingroup$ @user158565 Thanks for reply, I bet none, although I do not know exactly the distribution of my data, it should be something close to the normal distribution. Although I agree with you in that such expectation is not possible, I cannot find where is the mistake. $\endgroup$ Jan 4, 2019 at 2:57
  • $\begingroup$ I mean you should not get $\operatorname{E}[f^2]\approx 0$. $\endgroup$
    – user158565
    Jan 4, 2019 at 3:00
  • $\begingroup$ @user158565 I understand that, but I found that the Hessian evaluated at (0,0) is null (please, see the link in the question). Higher order terms maybe helps, or maybe I am doing something wrong in that part. In any case, I found rare that I get $\operatorname{E}[f^2]\approx 0$ up to second order. I would like to try it up to higher orders but I really do not know how to do that (I am chemist). $\endgroup$ Jan 4, 2019 at 3:06
  • $\begingroup$ I think the covariance between $x_A$ and $x_B$ is needed. Then you can try delta method. $\endgroup$
    – user158565
    Jan 4, 2019 at 3:10

1 Answer 1


Suppose you can get the covariance between $x_A$ and $x_B$. Let $$\Sigma = \left(\begin{matrix} Var(x_A) & Cov(x_A,x_b)\\ Cov(x_A,x_b) &Var(x_B) \end {matrix} \right)$$ $$\frac {\partial f}{\partial x} = \left(\begin{matrix} \frac {\partial f} {\partial x_A} & \frac {\partial f} {\partial x_B}\end {matrix} \right)$$

Then by delta method,

$$Var(f) \approx\left(\frac {\partial f}{\partial x}\right)\Sigma \left(\frac {\partial f}{\partial x}\right)^T$$

  • $\begingroup$ Thank you very much! I am not sure about how the derivatives (gradient?) must be expressed. Do they must be evaluated at some point, right? I suppose that at [0,0]. In such case I get Var(f) = 0 ! wolframalpha.com/input/?i=gradient+of+x*(e%5E(k*(x%2By))-1) $\endgroup$ Jan 4, 2019 at 3:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.