Multivariate normal distribution from invertable covariance matrix

939 Views Asked by At

I want to generate a random vector with $\mathcal{N}(0, C)$ distribution, i.e. normal distribution with $0$ mean and given covariance matrix $C$.

$C$ is not invertible (singular). Here it's written:

The covariance matrix is allowed to be singular (in which case the corresponding distribution has no density). This case arises frequently in statistics (...)

So, how can I do it without inverting $C$?

2

There are 2 best solutions below

0
On BEST ANSWER

We are looking for a vector $BX$ with covariance matrix $C$.

$C[BX]=E(BX⋅BX^T)=E(BX⋅X^T⋅B^T)= B⋅E(XX^T)⋅B^T = BIB^T = BB^T$

So, we get matrix $B$ straight from matrix $C$, decomposing it to $BB^T$.

For this we can use LU decomposition or, when $C$ is positive definite, Cholesky decomposition.

11
On

Hint: if $B$ is a matrix and $X$ is a normal random vector with covariance matrix $I$, what is the covariance matrix of $BX$?