# Sampling from a distribution with a given covariance matrix

Let $\bf X$ be a binary vector of $n$ (non-independent) random variables $X_1,\ldots, X_n$. Covariance of two random variables is defined as follows: $$\mathrm{cov}(X_i, X_j) = \mathrm{E}(X_i - \mu_i)(X_j - \mu_j),$$ where $\mu_i = \mathrm{E}(X_i).$ Covariance matrix for $\bf X$ is $n\times n$ symmetric matrix $C$, whose elements $c_{ij} = \mathrm{cov}(X_i, X_j)$.

Given a matrix $C$, are there any known efficient sampling algorithms for distribution that is close to the distribution of $\bf X$ (= distribution with the same matrix $C$)?

The same question for the case where $C$ is a correlation matrix: $$c_{ij} = \frac{\mathrm{cov(X_i, X_j)}}{\sigma(X_i)\sigma(X_j)},$$ where $\sigma(X_i)$ is a standard deviation of $X_i$.

Any hints on papers etc. are welcome!

Thanks, Sasha