Finding the covariance of $X$ from $XX^T$ and from its mean.

2k Views Asked by At

Given some samples $X(D\times N)$, I am trying to calculate their covariance, however, I only have access to the mean of $X$ ($D\times 1$) and the $D\times D$ matrix $XX^T$. Also $N$ is known.

My intution is that it is possible, but algebra / probability arent my strongest fields, and I feel like i'm missing some thing simple here.

Clarification: is a matrix of shape , where each column is one of the samples. $^$ is the multiplication of and the transpose, which would be the covariance if was zero mean.

Another clarification: We define the covariance with $\sum_{x\in X}(x-\mu)(x-\mu)^T$, if $\mu = 0$ then the covariance will simply be $XX^T$.

However, in my case $\mu \neq 0$, thus the covariance is $XX^T-XM^T-MX^T+n\cdot\mu \mu^T$, where $M$ is $D\times N$ matrix, which each column is $\mu$.

I have the leftmost and rightmost (can be calculated) items, and i am looking for the value of the middle ones, in order to find the covariance.

1

There are 1 best solutions below

0
On

Forgeting intro to probability is always bad.

$Cov(X) = E(XX^T)-\mu \mu^T$

Which is what I was looking for.