# Question:Variance of this sum of products of normally distributed random variables?

## Question:Variance of this sum of products of normally distributed random variables?

Maple

Question is attached:

I describe in words the problem I want to solve with Maple. I'll need to work with random variables.

I want to compute Var[A+B+C] where A, B, and C are not independent of each other. In particular, I don't know how to compute Cov[A,B], Cov[A,C], and Cov[B,C]. The model specifications follow.

Let:

 > A = X__1*(-lambda__1*X__1-lambda__1*delta__1+nu__1-nu__01); B = X__2*(-lambda__2*X__2-lambda__2*delta__2+nu__2-nu__02); A = X__3*(-lambda__3*X__3-lambda__3*delta__3+nu__1+nu__2-nu__01-nu__02);
 (1)

where lambda__1, lambda__2, and lambda__3 are constants. Moreover, nu__01 is the mean of nu__1~N(nu__01,sigma__nu^2)
and nu__02 is the mean of nu__2~N(nu__02,sigma__nu^2). Note that nu__1 and nu__2 have the same variance and are independent of each other.

 > X__1 = beta__1*(nu__1+nu__2-nu__01-nu__02)+alpha__1*delta__1+alpha__2s*delta__2; X__2 = beta__2*(nu__1+nu__2-nu__01-nu__02)+alpha__2*delta__2+alpha__1s*delta__1; X__3 = beta__3*(nu__1+nu__2-nu__01-nu__02)+alpha__3*delta__3;
 (2)

where beta__1, beta__2, beta__3, alpha__1, alpha__2, alpha__3, alpha__1s, alpha__2s are constants. Moreover, delta__1~N(0,sigma__d^2), delta__2~N(0,sigma__d^2), and delta__3~N(0,sigma__d3^2) (note the different variance for delta__3). The variables delta__1, delta__2, and delta__3 are independent of each other. Moreover, nu__1 and nu__2 are independent of delta__1, delta__2, and delta__3.

Now, A, B, C are all products of the form W*Q. In general, Var[W*Q] can be found by applying a formula*** which here reduces to Var[W*Q] = sigma__W^2*sigma__Q^2+(Cov[W,Q])^2, where Cov[W,Q] is simply E[W*Q] since E[W]=0 and E[Q]=0 in my three cases. In short, it's relatively straightforward to find Var[A], Var[B], and Var[C]. However, I don't know about the covariance terms. How to tackle the covariance terms, i.e., Cov[A,B], Cov[A,C], and Cov[B,C]?

***See @whuber's comment in Prof. Dilip Sarwate's answer here https://stats.stackexchange.com/questions/15978/variance-of-product-of-dependent-variables

Perhaps it would be useful to automate the computation of E[A+B+C] as well. However, I managed to compute the expectation by hand, with pen and paper. It would be nice to double check with a script.