3

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

user1420303
  • 527
  • 3
  • 8
  • What distribution has the property of $\operatorname{E}[f^2]\approx 0$ ? – user158565 Jan 04 '19 at 02:12
  • @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. – user1420303 Jan 04 '19 at 02:57
  • I mean you should not get $\operatorname{E}[f^2]\approx 0$. – user158565 Jan 04 '19 at 03:00
  • @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). – user1420303 Jan 04 '19 at 03:06
  • I think the covariance between $x_A$ and $x_B$ is needed. Then you can try delta method. – user158565 Jan 04 '19 at 03:10
  • @user158565 - that's correct. $E[kx_ax_b] \neq 0$ unless the covariance is zero, and $E[kx^2_A] \neq 0$ unless the variance of $x_A$ is zero. – jbowman Jan 04 '19 at 03:12
  • @user158565 Sorry, I cannot follow you. – user1420303 Jan 04 '19 at 03:15
  • @jbowman, Thank you for your comment. Yes, as you said, those expected values are not null. Because of this, the square of their sum is a positive number. This square must be subtracted from $\operatorname{E}[f^2]$ for obtaining the variance. As I get $\operatorname{E}[f^2]\approx 0$, I get a negative variance. – user1420303 Jan 04 '19 at 03:19

1 Answers1

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$$

user158565
  • 7,032
  • 2
  • 9
  • 19
  • 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 ! https://www.wolframalpha.com/input/?i=gradient+of+x*(e%5E(k*(x%2By))-1) – user1420303 Jan 04 '19 at 03:44