Any mean zero Gaussian random vector $\newcommand{\bR}{\mathbb{R}}$ on $ X=(X_1,\dotsc, X_n)\in\bR^n$ is uniquely determined by its covariance matrix $C$. This is a symmetric $n\times n$ matrix with entries $\newcommand{\bE}{\mathbb{E}}$
$$ C_{ij}=\bE[X_iX_j],\;\;1\leq i,j\leq n, $$
$\bE=$ expectation. The matrix $C$ is positive semidefinite, i.e., $\newcommand{\bx}{\boldsymbol{x}}$ $\newcommand{\by}{\boldsymbol{y}}$
$$ (C\bx,\bx)\geq 0,\;\;\forall \bx\in\bR^n. $$
To simulate (sample) such a random vector proceed as follows.
- Compute the square root of $C$.This is the unique symmetric positive definite $n\times n$ matrix $A$ such that $A^2=C$.
- Generate (simulate) $n$ independent standard normal random variables $Y_1,\dotsc, Y_n$. Denote by $Y$ the random vector $(Y_1,\dotsc, Y_n)$.
- The random vector $AY$ is Gaussian with covariance matrix $C$.