Tutorials › Statistical Theory I - Probability and Distribution Theory › Cholesky Construction of Gaussian Vectors

Multivariate Normal Distributions · Tutorial 714 of 994

Cholesky Construction of Gaussian Vectors

Learn how to factor a positive definite covariance matrix and use the factor to generate Gaussian vectors with the desired mean and covariance.

Advanced 10 min read

What You'll Learn

  • State the Cholesky construction for a Gaussian vector with prescribed mean and covariance
  • Explain why positive definiteness guarantees a unique lower-triangular Cholesky factor
  • Verify the mean and covariance of the constructed vector
  • Compute Cholesky factors for two- and three-dimensional covariance matrices
  • Distinguish the covariance-producing product \(LL^{T}\) from \(L^{T}L\)
  • Identify when the standard positive-diagonal Cholesky construction does not apply

From Independent Normal Inputs to a Target Covariance

A practical way to construct a multivariate Gaussian vector is to begin with independent standard normal variables and transform them linearly. The central task is choosing the transformation so that the resulting covariance is the one required. For a positive definite covariance matrix, the Cholesky factor gives a direct and uniquely specified choice.

This construction is useful both as a mathematical representation and as a method for simulation. It separates the random input, whose coordinates are independent, from the matrix calculation that creates the desired dependence. The key is to use the factor on the correct side of the covariance calculation.

Definition: Let \(\mu\in\mathbb{R}^p\), and let \(\Sigma\) be a symmetric positive definite \(p\times p\) matrix. Its Cholesky factor is the unique lower-triangular matrix \(L\) with strictly positive diagonal entries such that \(\Sigma=LL^T\). If \(Z\) has independent \(N(0,1)\) coordinates, the Cholesky construction is \(X=\mu+LZ\).

Here \(L^T\) denotes the transpose of \(L\). Positive definiteness means that \(v^T\Sigma v>0\) for every nonzero vector \(v\in\mathbb{R}^p\). The condition ensures that the standard Cholesky factor exists and has nonzero diagonal entries. The vector \(Z\) is standard multivariate normal, with mean zero and covariance \(I_p\), the \(p\times p\) identity matrix.

Why the Cholesky Factor Exists and Is Unique

The factorization is not an arbitrary square-root convention: positive definiteness guarantees a lower-triangular factor with positive diagonal entries, and that convention makes the factor unique. The following argument also explains the recursive calculation used in practice.

Theorem: Every symmetric positive definite matrix \(\Sigma\) has a unique factorization \(\Sigma=LL^T\), where \(L\) is lower triangular with strictly positive diagonal entries.

Proof. We use induction on the dimension \(p\). For \(p=1\), a positive definite matrix is the positive number \(a\), and its factor is \(L=(\sqrt{a})\), which is unique.

For the induction step, write a symmetric positive definite matrix in block form as \(\Sigma=\begin{pmatrix}a&b^T\\ b&C\end{pmatrix}\), where \(a\) is a scalar. Positive definiteness gives \(a>0\), by testing the first coordinate vector. Define \(S=C-bb^T/a\). For any nonzero \(y\in\mathbb{R}^{p-1}\), the vector \(v=(-b^Ty/a,y^T)^T\) is nonzero, and direct multiplication gives \(v^T\Sigma v=y^TSy\). Thus \(S\) is positive definite. By the induction hypothesis, \(S=RR^T\) for a unique lower-triangular \(R\) with positive diagonal.

Now set \(L=\begin{pmatrix}\sqrt a&0\\ b/\sqrt a&R\end{pmatrix}\). Multiplying gives \(LL^T=\begin{pmatrix}a&b^T\\ b&bb^T/a+RR^T\end{pmatrix}=\Sigma\). This proves existence. For uniqueness, any lower-triangular factor with positive diagonal must have first diagonal entry \(\sqrt a\), its remaining entries in the first column must be \(b/\sqrt a\), and its trailing block must factor \(S\). The induction hypothesis makes that trailing block uniquely \(R\). Hence \(L\) is unique. \(\square\)

Verifying the Distribution and Its Parameters

The construction is Gaussian because every linear combination of its coordinates is a linear combination of independent normal variables. Its mean and covariance can also be checked directly; no inference from the shape of a simulated scatterplot is needed.

Theorem: If \(Z\) has independent \(N(0,1)\) coordinates, \(L\) is a fixed \(p\times p\) matrix, and \(\mu\in\mathbb{R}^p\), then \(X=\mu+LZ\) is Gaussian with mean \(\mu\) and covariance \(LL^T\). In particular, if \(\Sigma=LL^T\) is positive definite, this construction gives \(X\sim N_p(\mu,\Sigma)\).

Proof. For any \(t\in\mathbb{R}^p\), \(t^TX=t^T\mu+(L^Tt)^TZ\). The characteristic function of \(Z\) is \(\exp(-u^Tu/2)\) at \(u\in\mathbb{R}^p\), since its coordinates are independent standard normals. Therefore \[ E[\exp(i t^TX)] =\exp(i t^T\mu)\exp\!\left(-\frac{1}{2}(L^Tt)^T(L^Tt)\right) =\exp\!\left(i t^T\mu-\frac{1}{2}t^TLL^Tt\right). \] This is the characteristic function of a Gaussian vector with mean \(\mu\) and covariance \(LL^T\), so it identifies the distribution. Directly, linearity of expectation gives \(E[X]=\mu+LE[Z]=\mu\). Since \(X-\mu=LZ\), its covariance is \[ \operatorname{Cov}(X)=L\operatorname{Cov}(Z)L^T=L I_p L^T=LL^T. \] Thus when \(LL^T=\Sigma\), the constructed vector has the specified Gaussian distribution and parameters. \(\square\)

Worked Example: A Two-Dimensional Construction

Construct a Gaussian vector with mean \(\mu=(1,-2)^T\) and covariance \(\Sigma=\begin{pmatrix}4&2\\2&3\end{pmatrix}\). First, verify positive definiteness and find its Cholesky factor.

The leading principal minors are \(4>0\) and \(\det(\Sigma)=4(3)-2(2)=8>0\), so the symmetric matrix is positive definite. Write \(L=\begin{pmatrix}l_{11}&0\\l_{21}&l_{22}\end{pmatrix}\), with positive diagonal. Matching entries of \(LL^T\) to \(\Sigma\) gives \(l_{11}^2=4\), \(l_{11}l_{21}=2\), and \(l_{21}^2+l_{22}^2=3\). Hence \(l_{11}=2\), \(l_{21}=1\), and \(l_{22}=\sqrt{2}\).

Indeed, \(LL^T=\begin{pmatrix}2&0\\1&\sqrt2\end{pmatrix}\begin{pmatrix}2&1\\0&\sqrt2\end{pmatrix}=\begin{pmatrix}4&2\\2&3\end{pmatrix}\). For independent \(Z_1,Z_2\sim N(0,1)\), the required construction is \(X=\begin{pmatrix}1\\-2\end{pmatrix}+\begin{pmatrix}2&0\\1&\sqrt2\end{pmatrix}\begin{pmatrix}Z_1\\Z_2\end{pmatrix}\). Equivalently, \(X_1=1+2Z_1\) and \(X_2=-2+Z_1+\sqrt2Z_2\). Its mean is \((1,-2)^T\), its first variance is \(4\), its second variance is \(1+2=3\), and its covariance is \(2\cdot1=2\), as required.

Computing a Three-Dimensional Factor

For larger matrices, the same entry-matching principle proceeds down the columns. If \(\Sigma=(\sigma_{ij})\) and \(L=(l_{ij})\) is lower triangular, then \(\sigma_{ij}=\sum_{k=1}^{j}l_{ik}l_{jk}\) for \(i\ge j\). The diagonal entries are chosen positive; each new entry is determined by the already computed entries.

Worked Example: Recovering a Three-Dimensional Cholesky Factor

Let \(\Sigma=\begin{pmatrix}4&2&-2\\2&5&1\\-2&1&6\end{pmatrix}\). Compute its Cholesky factor and give a Gaussian construction with mean \(\mu=(0,1,3)^T\).

Start with \(l_{11}=\sqrt{4}=2\). Then \(l_{21}=\sigma_{21}/l_{11}=2/2=1\) and \(l_{31}=\sigma_{31}/l_{11}=-2/2=-1\). The second diagonal entry satisfies \(l_{22}=\sqrt{\sigma_{22}-l_{21}^2}=\sqrt{5-1}=2\). Next, \(l_{32}=(\sigma_{32}-l_{31}l_{21})/l_{22}=(1-(-1)(1))/2=1\).

The final diagonal entry is \(l_{33}=\sqrt{\sigma_{33}-l_{31}^2-l_{32}^2}=\sqrt{6-1-1}=2\). Therefore \(L=\begin{pmatrix}2&0&0\\1&2&0\\-1&1&2\end{pmatrix}\). Multiplication verifies the factor: \(LL^T=\begin{pmatrix}4&2&-2\\2&5&1\\-2&1&6\end{pmatrix}\). Because \(L\) is nonsingular, for every nonzero \(v\), \(v^T\Sigma v=v^TLL^Tv=\|L^Tv\|^2>0\); this also checks positive definiteness.

For independent standard normal \(Z_1,Z_2,Z_3\), set \(X=\mu+LZ\). Coordinatewise, \(X_1=2Z_1\), \(X_2=1+Z_1+2Z_2\), and \(X_3=3-Z_1+Z_2+2Z_3\). The mean is \((0,1,3)^T\), and the covariance is \(LL^T=\Sigma\), so \(X\sim N_3(\mu,\Sigma)\).

Covariance, Correlation, and the Side of the Factor

A covariance matrix specifies both the marginal variances and the dependence between coordinates. The diagonal entries of \(L\) alone are not generally the marginal standard deviations: those variances are the diagonal entries of \(LL^T\), which include contributions from all entries in the corresponding row of \(L\).

Worked Example: Constructing a Specified Correlation

Suppose two coordinates should have means \(1\) and \(-1\), standard deviations \(2\) and \(3\), and correlation \(3/5\). Their covariance is \((2)(3)(3/5)=18/5\), so \(\Sigma=\begin{pmatrix}4&18/5\\18/5&9\end{pmatrix}\).

The Cholesky entries are \(l_{11}=2\), \(l_{21}=(18/5)/2=9/5\), and \(l_{22}=\sqrt{9-(9/5)^2}=\sqrt{144/25}=12/5\). Thus \(L=\begin{pmatrix}2&0\\9/5&12/5\end{pmatrix}\), and multiplication gives \(LL^T=\begin{pmatrix}4&18/5\\18/5&(81+144)/25\end{pmatrix}=\Sigma\).

With independent standard normal \(Z_1,Z_2\), the construction is \(X_1=1+2Z_1\) and \(X_2=-1+(9/5)Z_1+(12/5)Z_2\). Its variances are \(4\) and \(9\); its covariance is \(2(9/5)=18/5\). Hence its correlation is \((18/5)/(\sqrt4\sqrt9)=3/5\), as specified.

The product order matters. The construction is \(X=\mu+LZ\), so its covariance is \(L\operatorname{Cov}(Z)L^T=LL^T\). In general \(L^TL\) is a different matrix and does not provide the target covariance for this construction. If a different square root is used, it must be checked against the actual transformation and covariance calculation rather than assumed to be interchangeable.

Common Pitfalls and Practical Use

  • Using the wrong product. Matching \(L^TL\) to \(\Sigma\) does not usually make \(\mu+LZ\) have covariance \(\Sigma\). Compute \(\operatorname{Cov}(LZ)=LL^T\).
  • Forgetting to add the mean. \(LZ\) has mean zero. The prescribed nonzero mean requires the shift \(\mu\).
  • Confusing factor entries with marginal standard deviations. The marginal variance of coordinate \(i\) is the sum of the squared entries in row \(i\) of \(L\), not necessarily \(l_{ii}^2\).
  • Applying the standard factorization to a non-positive-definite matrix. A singular covariance does not have a Cholesky factor with strictly positive diagonal entries. The construction here assumes positive definiteness; singular Gaussian laws require a different factorization or representation.

In computation, this method turns a supply of independent normal draws into draws from a specified nonsingular multivariate Gaussian distribution. It also makes the role of the covariance model transparent: the factor mixes independent inputs, and the matrix product \(LL^T\) records exactly the variances and covariances that result.

Key takeaway: For symmetric positive definite \(\Sigma\), find its unique lower-triangular factor \(L\) with positive diagonal such that \(\Sigma=LL^T\). If \(Z\) has independent standard normal coordinates, then \(X=\mu+LZ\) is Gaussian with mean \(\mu\) and covariance \(\Sigma\).

Check Your Understanding

Use the construction and covariance calculation to answer these questions.

  1. For \(L=\begin{pmatrix}1&0\\2&3\end{pmatrix}\), compute \(LL^T\). What covariance matrix does \(X=\mu+LZ\) have?
  2. Why does a lower-triangular factor with strictly positive diagonal entries have to be unique?
  3. For independent standard normal coordinates, verify directly that the covariance between \(X_1=Z_1\) and \(X_2=2Z_1+Z_2\) is \(2\).
  4. What condition on \(\Sigma\) guarantees the standard Cholesky factor with positive diagonal entries, and why is that condition relevant to the construction?
  5. Explain why \(L^TL\) cannot generally be substituted for \(LL^T\) when \(X=\mu+LZ\).