Sunday 23 August 2026

Quant interview

The equicorrelation matrix and how negative correlation can go

easy · Eigenvalues, positive semidefiniteness and covariance

Fix an integer n≥2 and a scalar ρ∈ℝ. Consider the n×n matrix R=(1−ρ)In+ρ11⊤, where In is the identity, 1=(1,…,1)⊤∈ℝn, so that R has 1 on the diagonal and ρ in every off-diagonal entry. Think of R as the correlation matrix of n unit-variance assets that share a common pairwise correlation ρ.

  1. Find all eigenvalues of R and their multiplicities.
  2. Determine the exact set of values of ρ for which R is a valid correlation matrix, i.e. positive semidefinite.
  3. Let w=1n1 be the equal-weight portfolio. Compute its variance w⊤Rw, and use it to explain what the lower bound found in part 2 means as n→∞.
Solution

Eigenvalues

Write R=(1−ρ)In+ρJ with J=11⊤ the all-ones matrix. The key observation — the step a candidate should reach for immediately — is that J is rank one, so its spectrum is trivial: J1=n1, and Jv=0 for every v⟂1. Hence J has eigenvalue n once (eigenvector 1) and eigenvalue 0 with multiplicity n−1 (the orthogonal complement of 1).

Adding a multiple of the identity shifts every eigenvalue by the same amount and keeps the eigenvectors, so the eigenvalues of R=(1−ρ)In+ρJ are

λ1=(1−ρ)+ρn=1+(n−1)ρ(multiplicity 1),

λ2=1−ρ(multiplicity n−1).

As a check, the trace is λ1+(n−1)λ2=1+(n−1)ρ+(n−1)(1−ρ)=n, matching trR=n.

Positive semidefiniteness

A symmetric matrix is positive semidefinite iff all its eigenvalues are nonnegative. So we need both

1−ρ≥0and1+(n−1)ρ≥0,

which give ρ≤1 and ρ≥−1n−1. Therefore

ρ∈[−1n−1,1].

The tempting wrong answer is ρ∈[−1,1], obtained by thinking of ρ as an ordinary pairwise correlation. That is necessary but not sufficient: a single pair can be perfectly anticorrelated, but n assets cannot all be that negatively correlated with one another simultaneously.

Portfolio-variance interpretation

For the equal-weight portfolio w=1n1,

w⊤Rw=1n21⊤R1=1n2(n+n(n−1)ρ)=1+(n−1)ρn.

This is exactly λ1/n, since 1 is the eigenvector for λ1. Requiring this variance to be nonnegative recovers the binding constraint ρ≥−1n−1.

As n→∞, the lower bound −1n−1→0−. Interpretation: a large book of assets cannot maintain a common negative pairwise correlation. The most negative correlation compatible with all pairs being equal shrinks to zero, because diversification would otherwise drive the equal-weight portfolio variance below zero — impossible.

Final answers:

Statistics in machine learning

When a narrow proposal starves the importance sampler

medium · Importance sampling and effective sample size

Let the target be the standard normal p=𝒩(0,1) and the proposal a centered normal q=𝒩(0,σ2) with σ2>0. Draw X1,…,Xn~iidq and form the importance weights w(x)=p(x)q(x). The standard diagnostic for importance sampling is the effective sample size ESS^=(∑i=1nw(Xi))2∑i=1nw(Xi)2, and we study its per-sample limit ρ(σ2):=limn→∞ESS^/n (in probability).

  1. Compute 𝔼q[w(X)] and 𝔼q[w(X)2] in closed form. State precisely the range of σ2 for which the second moment is finite, and explain in one line what the limit ρ(σ2) equals in terms of these moments and why.

  2. Give ρ(σ2) in closed form on the region where it is positive. Find the value of σ2 that maximizes it and the maximum value.

  3. Solve ρ(σ2)=12 exactly. Comment on the two roots: which regime (proposal too narrow, or too wide) is the dangerous one, and why.

Solution

The weight and its two moments

With p(x)=(2π)−1/2e−x2/2 and q(x)=(2πσ2)−1/2e−x2/(2σ2), w(x)=p(x)q(x)=σexp(−x22(1−1σ2)).

First moment. By construction the weight integrates the target against the proposal, so 𝔼q[w]=∫p(x)q(x)q(x)dx=∫p(x)dx=1. This holds for every σ2; it is what makes ordinary (non-normalized) importance sampling unbiased.

Second moment. This is the step that carries all the information: 𝔼q[w2]=∫p(x)2q(x)dx. Now p(x)2q(x)=(2π)−1e−x2(2πσ2)−1/2e−x2/(2σ2)=σ2πexp(−(1−12σ2)x2). The Gaussian integral ∫e−ax2dx=π/a converges iff the coefficient a=1−12σ2>0, i.e. iff σ2>12. When it does, 𝔼q[w2]=σ2ππ1−1/(2σ2)=σ2−1/σ2=σ22σ2−1. For σ2≤12 the integral diverges: 𝔼q[w2]=+∞. (This is exactly 1+χ2(p‖q), the chi-square divergence, so the divergence has a name.)

Why ρ is a ratio of these moments. By the law of large numbers, 1n∑w(Xi)→𝔼q[w]=1 and 1n∑w(Xi)2→𝔼q[w2] (the latter finite only when σ2>12). Hence ρ(σ2)=limn→∞ESS^n=(1n∑w)21n∑w2=𝔼q[w]2𝔼q[w2]=11+Varq(w)/𝔼q[w]2. When 𝔼q[w2]=∞ the denominator diverges and ρ=0: the effective sample size is o(n).

The closed form and its optimum

For σ2>12, ρ(σ2)=1𝔼q[w2]=2σ2−1σ2, and ρ(σ2)=0 for σ2≤12.

Write t=σ2 and maximize g(t)=t−12t−1: g′(t)=t(2t−1)−1/2−(2t−1)1/2t2=0⟺t=2t−1⟺t=1. So the maximum is at σ2=1, where ρ(1)=1/1=1. This is the sanity check: q=p gives constant weights and full effective sample size, ρ=1.

Solving ρ=12

Set 2t−1/t=12 with t>12. Squaring, 2t−1t2=14⟹t2−8t+4=0⟹t=4±23. Both roots exceed 12 (indeed 4−23=(3−1)2≈0.536 and 4+23≈7.46), so both are admissible: σ2=4−23≈0.536andσ2=4+23≈7.46.

Interpretation. The efficiency curve ρ is single-peaked at σ2=1 and falls off on both sides, so a given efficiency level is hit once on each side. But the two sides are not symmetric in their failure mode. Making the proposal too narrow (σ2≤12) sends ρ to a hard zero — the weight variance is literally infinite, the LLN for ESS^ fails, and a handful of samples in the target's tail carry all the mass. Making it too wide only degrades ρ smoothly toward 0 as σ2→∞ (since ρ~2σ−1), with all moments finite throughout. The lesson every practitioner eventually relearns: overdisperse the proposal, never underdisperse it.

Closing note

The tempting error is to treat ρ(σ2) as finite and positive for all σ2 — the closed form 2σ2−1/σ2 formally returns a complex number for σ2<12, which quietly hides the real event: the second moment has diverged and the estimator's asymptotic variance is infinite. The convergence condition a=1−1/(2σ2)>0 is the whole point of the problem, not a technicality.


Two new problems every morning at 8am · every day so far