# Obtaining the covariance matrix of a Gaussian random vector

I'm looking for some advice about a problem I've been assigned to solve. This is the problem. Suppose a car has to travel from P1 to P4, with intermediate points P2, P3. Say $X1$ is a r.v. that defines the travel time from P1 to P2 is normally distributed with $\mu$ = 25, $\sigma^2$ = 3, similarly $X2$ is a r.v. for the travel time from P2 to P3 and $X2 \sim N(15,3)$, finally X3 is a r,v, for the travel time from P3 to P4 and $X3 \sim N(20,1)$ . Then define a random vector $(T2,T3,T4)$ with the times when the car passes by P2,P3 and P4.

I have to define the distribution of the random vector ${\bf t}=[T2,T3,T4]$ through its covariance matrix and its $\mu$ vector of expectations. Here is what I´ve done so far:

• $T2$ would be distributed just as $X1$. $T3$ would be defined as $X1+X2$, and $T4$ would be defined as $X1+X2+X3$. Then $T3$ would also be gaussian distributed since the sum of gaussians is a gaussian, and the distribution would be $N(25+15,3+3)=N(40,6)$. Following a similar reasoning, $T4 \sim N(25+15+20,3+3+1)=N(60,7)$. Then, if I define a vector ${\bf u}=[U_1,U_2,U_3]$ where $U_i \sim N(0,1)$, then ${\bf Au+\mu}$ should define the vector ${\bf t}$. If we define ${\bf A}$ as:

$$\begin{bmatrix} \sqrt3 & 0 & 0\\ 0 & \sqrt6 & 0\\ 0 & 0 & \sqrt7 \end{bmatrix}$$

and $\mu$ as $[15,40,60]$, then ${\bf Au+\mu}$ would define the distribution of vector ${\bf t}$, and the covariance matrix would be ${\bf \Sigma = AA^t}$. Is it correct? I am not sure because I think that somehow $T2$ would affect $T3$ and $T4$ and therefore $Cov(T2,T3), Cov(T3,T4)$ would not be zero.

Also I have to find the probability that the travel time from $P1$ to $P4$ is greater than 70. I think this would be solved as $P(T4>70)$, since $T4 \sim N(60,7)$,if this is true I just simply have to normalize and take a look and the normal distribution table or go to R and type pnorm(70,60,7). Do you think it is correct?

Finally, I have to estimate the moment when the car passed by P3, given that it is known that it arrived at P4 in 65.234 time units. Also, if I know that it passed by P2 in 26.1 time units, I have to estimate the moment when the car passed by P3. In this point I'm lost and don't know exactly what to do.

So this is it, sorry for the looong post. Thanks for reading. Any comments and suggestions are deeply apreciated.

-
 Forgot to mention in my post that $X1,X2,X3$ all are independent – Robst Oct 21 '12 at 14:25 I don't understand why you have square roots on the main diagonal. If A is the variance-covariance matrix, the main diagonal should have the variances going down the main diagonal, shouldn't it? – gung Oct 21 '12 at 21:44 Oh, A is not the Covariance Matrix, $C$ is a Matrix such that, $AA'=C$, where $C$ is the Covariance Matrix. However, that $A$ matrix I showed is not correct. The answer of Sam gives a hint on how to correctly calculate it. – Robst Oct 22 '12 at 16:25

I think that for the covariance between $T2$ and $T3$ you could try substituting in $T2 = X1$ and $T3 = X1 + X2$.
So: $$Cov(T2,T3) = Cov(X1,X1+X2) = Cov(X1,X1) + Cov(X1,X2)$$
If you assume that $X1$ and $X2$ are independent and remember that $Cov(A,A) = Var(A)$ then you might get what you need here. Then follow this blueprint to fill out the rest of the terms in $\Sigma$.
For the second part of the question ($P(T4>70)$) I think you've got the right idea.
For the last bit, note that you are estimating $T3$ conditional on knowing $T2$, i.e. $T3|T2 = 26.1$ which could be written $X1+X2|X1 = 26.1$. The randomness associated with $X1$ is basically removed from the problem, because you know it. Try thinking along those lines. Similarly if you know $X1+X2+X3 = 65.234$, how can you use that knowledge to estimate $X1+X2$? (try rearranging the equation to start with). Hope it helps.
 Hello @sam-livingstone, thank you so much for taking the time to read and answer my post. So, I think I get the idea about the first point. So, given that $Cov(T2,T3)=Cov(X1,X1+X2)=Cov(X1,X1)+Cov(X1,X2)$, and $X1,X2,X3$ are all independent, forgot to mention that in my post,then $Cov(T2,T3)$ would be $Var(X1)+0=Var(X1)$, right? – Robst Oct 21 '12 at 14:23 And regarding the third point, in the first part of it, when I'm asked to estimate $T3|T4=65.234$,I think that $E[T3|T4=65.234]$ would be equal to $65.234 - E[X3]$ ,since $E[T4]=E[X1+X2+X3]=65.234$, from that I can obtain that $E[X1+X2]=E[T3]=65.234-E[X3]=65.234-20=45.234$. Then, for the second part, estimating $T3|T2=26.1,T4=65.234$, I think it would be calculated as follows: $E[X1+X2+X3]=65.234$, and knowing that $E[X1]=26.1$, then we have $E[X2+X3]=39.134$. In the previous step we estimated $E[X3|X4=65.234]$ as 20, so E[X2] would be estimated as 19.134...Somehow I feel I'm missing something – Robst Oct 21 '12 at 15:29