Generating 2D random vector from 4D covariance matrix

322 Views Asked by At

I have such covariance matrix $C$:

 0.03125 -0.03125 -0.03125  0.03125
-0.03125  0.03125  0.03125 -0.03125
-0.03125  0.03125  0.03125 -0.03125
 0.03125 -0.03125 -0.03125  0.03125

I want to generate 2D random vector with distribution $\mathcal{N}(0,C)$.

So, I'm decomposing $C$ to have $L$ using LU decompositon. This is $L$:

 1 0 0 0
-1 1 0 0
-1 0 1 0
 1 0 0 1

Now, if I want 4D random vector, my answer would be $LZ$. But I want a 2D random vector. Could you help me?

Why I want 2D random vector? Because I have a Differential Evolution algorithm and a population of 4 points in 2D. The points are in (1,1), (1,2), (2,1), (2,2). I want to generate another point (mutant) basing on the content of the population, so with distribution $\mathcal{N}(0,C)$. But my point is 2D, not 4D, like the covariance matrix.

1

There are 1 best solutions below

0
On BEST ANSWER

Covariance matrix of such population $X$ is 2D, not 4D:

1 1
1 1

$C[i, j] = \sum_{k=1}^{|X|}(x_i^k-\bar{x_i})(x_j^k-\bar{x_j})$.