Hexa Scholar

Cholesky decomposition: how do you mix independent noise?

A navy mixing console with a gold knob and an ivory knob on a wooden table, with two cables behind it.
The knobs on a mixing console are a metaphor for the weights you set on two noise inputs.

The question

Can you mix independent inputs to match a target covariance?

Set the weights and check them on the same cloud of inputs.

  1. 1 SeeFill the entries of a triangular mixer.
  2. 2 TryPredict a pivot and test its limits.
  3. 3 ProveBuild the factor one entry at a time.
  4. 4 ApplyUse the factor for noise and equations.
Before you start · 3 quick checks on transpose, covariance, and signs of quadratic forms

Two ideas before you start

2 ideas

Each row tells you what goes into one output

The first row uses the first input. The second row can use both inputs.

A lower-triangular mixer reads inputs in order. The first output uses the first input, and the second can use both.

Exact definition

Let \(Z=(Z_1,Z_2)^\mathsf T\) be a column of inputs. Write \(a,b,d\) for the entries on or below the diagonal of the real matrix \(L\).

\[\begin{aligned} L&=\begin{pmatrix}a&0\\b&d\end{pmatrix},\\ X&=LZ,\\ X_1&=aZ_1,\\ X_2&=bZ_1+dZ_2. \end{aligned}\]

Lower triangular means the entries above the diagonal are zero. We use \(a\gt0\) and \(d\ge0\) in the two-input activity.

A covariance matrix gives spread and co-movement

A diagonal entry gives a variance. An off-diagonal entry gives a covariance.

A variance measures the spread of one variable. Covariance measures how two variables move together around their means.

Exact definition

For real random variables \(U,V\) with finite second moments, covariance is the expected product of the deviations \(U-\mathbb E[U]\) and \(V-\mathbb E[V]\). The variance of \(U\) is \(\operatorname{Cov}(U,U)\). In a covariance matrix, row \(i\) and column \(j\) meet at the covariance of variables \(i\) and \(j\). Switching the variables leaves the product unchanged, so the matrix is symmetric.

Correlation is covariance divided by the product of the standard deviations. It is defined when both variances are positive. See covariance and correlation.

Fine print on the inputs

The clouds use pairs of independent standard normal draws. Each input has population mean zero and variance one. Standard normal means a normal distribution with that mean and variance. The two inputs have zero population covariance by independence. For the covariance calculation alone, centered inputs with unit variances and zero covariance suffice.

Each dot represents one pair of draws. The goal concerns the population covariance, meaning the covariance under the model before a finite sample is drawn. The points let you see what one finite sample from that model can look like.

1 See

Build a mixer for the target

How the game scores a mixer

The sample score shows the gap between your cloud’s Pearson correlation and the target correlation. Pearson correlation uses the deviations from the cloud’s coordinate means. A finite cloud can have a different correlation from the population even when the mixer is exact. If one output is constant, the sample correlation is undefined.

The match score uses the population entries calculated from your mixer. A correlation can stay the same when you scale a variable by a positive constant, even though the variance changes. That is why a small sample gap alone cannot win the game.

2 Try

How much room is left for the second input?

Check your prediction to open the explorer.

3 Prove

Find each entry from the target

Theorem

Let \(v,c,w\) be real with \(v\gt0\), and set \(\Sigma=\begin{pmatrix}v&c\\c&w\end{pmatrix}\). The target entries are first variance \(v\), covariance \(c\), and second variance \(w\) when \(\Sigma\) is a covariance matrix. Define \(s=w-c^2/v\).

There is a real lower-triangular \(L\) with \(a\gt0\), \(d\ge0\), and \(\Sigma=LL^\mathsf T\) exactly when \(s\ge0\). When it exists it is unique in this convention. It has both diagonal entries positive exactly when \(\Sigma\) is positive definite, meaning \(x^\mathsf T\Sigma x\gt0\) for every nonzero real column \(x\).

Match the entries in order. In the first three lines the matching equations are necessary conditions for a factor. Then use those conditions to decide when the factor exists.

4 Apply

Problems

Work from a target covariance, read a correlation from a factor, and use a factor to solve a system. Each problem has hints and a worked solution.

Key point To simulate noise, apply \(L\) to each fresh input vector. To solve \(\Sigma x=f\) for a positive definite \(\Sigma\), solve \(Ly=f\) and then \(L^\mathsf T x=y\). Both solves use substitution, as in linear systems.
Level Intermediate Prerequisites Positive semidefinite matrices and matrix multiplication Time About 25 min

Further reading