# Under what conditions is an arbitrary matrix $A$ the covariance matrix of a column vector of random variables?

Let $$X = \begin{bmatrix} X_1 & X_2 & \dots& \ X_n \end{bmatrix} ^{T}$$ be an arbitrary column vector of random variables.

Given an $$n \times n$$ matrix $$A$$, how do I determine whether there exists an $$X$$ such that $$K_{XX} = A$$ ? I'm asking about both the case where the elements of $$X$$ are constrained to be independent and the case where the elments of $$X$$ are not constrained to be independent.

Paraphrasing a bit from Wikipedia, let $$X' = X - \text{E}[X]$$ and $$Y' = Y - \text{E}[Y]$$ .

$$K_{XY} \;\; \stackrel{\text{def}}{=} \;\; \text{E}[X'(Y'^T)]$$

which means:

$$K_{XX} \;\; \stackrel{\text{def}}{=} \;\; \text{E}[X'(X'^T)]$$

Which I think means that the $$ij$$th entry looks like this:

$$(K_{XX})_{ij} \;\;\stackrel{\text{def}}{=}\;\; \text{E}[X'X']_{ij}$$

And this is where I get stuck. Since multiplication is commutative, in order for $$A$$ to be the covariance matrix of some column vector of random variables, it has to be symmetric.

However, as for actually working backwards and picking individual random variables inside $$X'$$ I'm stumped.

If I constrain each random variable in $$X'$$ to be independent, then I'm still picking a càdlàg CDF for each variable, up to the restriction that the mean is zero. That's a huge amount of freedom, so it seems like it should be possible to hit an arbitrary symmetric matrix $$A$$.

But that's just a vague intuition. I'm not sure how to break the problem down and prove it one way or the other.