2

As has been answered previously, the proof of cov(AX) = A cov(X) A' with X being a random vector and A a fixed matrix is relatively straightforward here.

In order to get a more visual sense of random vectors, I was trying to "proof" this equality to myself by generating random data in R, like this:

    set.seed(0)
    a <- c(rnorm(1e6,6,3))
    b <- c(rnorm(1e6,11,8))
    X <- rbind(a,b)
    A <- matrix(c(9, 100, 20, 200), nrow=2)
     [,1] [,2]
[1,]    9   20
[2,]  100  200

From there, calculating the $RHS$ of the equality is probably the result of:

A %*% cov(t(X)) %*% t(A)
          [,1]      [,2]
[1,]  26346.71  264277.7
[2,] 264277.71 2651783.0

The question is how to calculate the $LHS$ of the equation.

1 Answers1

0

Following Dougal's suggestion, I used the transposed to solve the computation bypassing a Reached total allocation of 3978Mb: see help(memory.size) initial message the same way I did on the calculation for the $RHS$ of the equation.

On the $RHS$ instead of calculating A %*% cov(X) %*% t(A) , which was giving me a similary memory problem, I calculated A %*% cov(t(X)) %*% t(A), which I hope is exactly the same, cov(X) = cov(t(X)), even though I haven't been able to conclusively verify it.

On the $LHS$ I went about as: cov(t(A%*%X)) with the identical result as before.

The fact that in both cases I'm getting:

          [,1]      [,2]
[1,]  26346.71  264277.7
[2,] 264277.71 2651783.0

is promising, but I'd welcome feedback as to the correctness of the linear algebra, possibly moving back this part as an edit to the original question.