Quant Memo
Foundational

Inner Products and Orthogonality

A way to measure angle and length between vectors using pure arithmetic — and the special case of orthogonality, where two directions carry completely unrelated information.

Prerequisites: Vector Spaces and Bases

Two trading signals might overlap heavily in what they capture, or might be measuring completely independent things — and correlation, the number analysts use to check this, is secretly a rescaled inner product. Inner products give vectors a notion of angle and length using nothing but multiplication and addition, and the special case of a zero inner product — orthogonality — is the mathematical meaning of "these two directions share nothing in common."

An analogy: how much two flashlights overlap

Point two flashlights at a wall from the same spot. If they point in exactly the same direction, their beams overlap completely. If they point at right angles to each other, their beams don't overlap at all — knowing where one beam hits tells you nothing about where the other hits. Anywhere in between, the beams partially overlap, and the amount of overlap can be measured precisely. The inner product of two vectors captures exactly this idea of overlap: large and positive when vectors point the same way, zero when they point in genuinely unrelated ("perpendicular") directions, negative when they point opposite ways.

The mathematics, one symbol at a time

For vectors u=(u1,,un)u = (u_1, \ldots, u_n) and v=(v1,,vn)v = (v_1, \ldots, v_n), the standard inner product (dot product) is

u,v=i=1nuivi=uvcosθ,\langle u, v \rangle = \sum_{i=1}^{n} u_i v_i = \|u\|\,\|v\|\cos\theta,

where u\|u\| and v\|v\| are the vectors' lengths and θ\theta is the angle between them. In words: multiply corresponding entries and sum them, and the result equals the product of the two lengths scaled by how aligned they are (via the cosine of the angle between them) — fully aligned vectors (θ=0\theta=0) give the largest possible positive value, and perpendicular vectors give zero regardless of their lengths. Two vectors are orthogonal when u,v=0\langle u,v\rangle = 0, meaning θ=90°\theta = 90°: they point in genuinely independent directions, and neither has any component lying along the other. Correlation between two return series is exactly this cosine, computed on the vectors after subtracting their means — correlation is the cosine of the angle between two (mean-centered) data vectors.

Worked example 1: computing an inner product and checking orthogonality

Let u=(3,4)u = (3, 4) and v=(4,3)v = (4, -3). Inner product: u,v=3(4)+4(3)=1212=0\langle u,v\rangle = 3(4) + 4(-3) = 12 - 12 = 0. These two vectors are exactly orthogonal — perpendicular in the plane — which you can also see by noting uu's direction is "3 right, 4 up" and vv's is "4 right, 3 down," a 90° rotation of the first. Now check w=(1,1)w = (1,1) against uu: u,w=3(1)+4(1)=70\langle u,w\rangle = 3(1)+4(1)=7 \neq 0, so uu and ww are not orthogonal — they share some common direction.

Worked example 2: correlation as a cosine

Two mean-centered daily return series (deviations from their own averages) are u=(2,1,1)u=(2,-1,-1) and v=(1,0,1)v=(1,0,-1). Inner product: u,v=2(1)+(1)(0)+(1)(1)=2+0+1=3\langle u,v\rangle = 2(1)+(-1)(0)+(-1)(-1)=2+0+1=3. Lengths: u=4+1+1=62.449\|u\|=\sqrt{4+1+1}=\sqrt6\approx2.449, v=1+0+1=21.414\|v\|=\sqrt{1+0+1}=\sqrt2\approx1.414. Correlation =cosθ=u,v/(uv)=3/(2.449×1.414)3/3.4640.866=\cos\theta = \langle u,v\rangle/(\|u\|\|v\|) = 3/(2.449\times1.414)\approx 3/3.464\approx 0.866. A correlation of 0.866 corresponds to an angle of about 30°30° between the two return vectors — strong alignment, far from the 90° that would signal orthogonal (uncorrelated) signals.

Correlation explorer
X →Y ↑
ρ = 0.60r² = 0.36relationship: moderate positive

Drag the correlation slider above: as ρ\rho moves toward 1 or −1, the scatter tightens into a line — the two variables' underlying vectors are nearly aligned or nearly opposite — and as ρ\rho approaches 0, the cloud rounds out, matching two vectors sitting near 90° apart.

small angle: high correlation right angle: orthogonal
Left: two nearly-aligned vectors, small angle, high correlation. Right: two perpendicular vectors, 90 degrees apart, zero inner product — orthogonal, meaning genuinely unrelated.

What this means in practice

Orthogonality is the goal behind constructing "clean," non-overlapping factors or signals — a signal orthogonalized against known market factors carries genuinely new information rather than repackaging an existing exposure (see Orthogonalising a Signal Against Known Factors). Inner products also underlie projection, least-squares fitting, and the Gram-Schmidt process for building an orthogonal basis from any starting set of vectors.

The inner product u,v=uivi\langle u,v\rangle = \sum u_iv_i measures both length and alignment between two vectors at once, equaling uvcosθ\|u\|\|v\|\cos\theta; two vectors are orthogonal exactly when this is zero, meaning they point in genuinely unrelated directions — and correlation between return series is precisely this cosine computed on mean-centered data.

Orthogonal (zero linear correlation) does not mean unrelated in every sense. Two vectors, or two return series, can have zero inner product yet still be strongly related through a nonlinear pattern — for instance, u=(2,1,0,1,2)u=(-2,-1,0,1,2) and v=(4,1,0,1,4)v=(4,1,0,1,4) (a perfect parabola) have an inner product of 81+0+1+8=0-8-1+0+1+8=0, orthogonal by this measure, despite vv being an exact deterministic function of uu. Orthogonality only rules out linear relationships; always ask whether a nonlinear dependence could still be hiding behind a zero inner product.

Related concepts

Practice in interviews

Further reading

  • Strang, Introduction to Linear Algebra, ch. 4
  • Axler, Linear Algebra Done Right, ch. 6
ShareTwitterLinkedIn