A matrix built from cyclic row shifts shares a Fourier eigenbasis. Follow a three-point filter, its complex spectrum and the boundary assumption behind FFT speed.
Circulant matrix
A circulant matrix is a square matrix whose rows are successive cyclic shifts of its first row. The last entry wraps back to the first position. This structure turns a periodic linear filter into independent frequency calculations, giving quants a route to fast filtering and structured linear solves. The periodic boundary is part of the model: it must make sense for the data.
Here we shift each row one place to the right. For first row (c0,…,cn−1) and zero-based indices,
Cij=c(j−i)modn,i,j=0,…,n−1.
A circulant is a special Toeplitz matrix: its diagonals are constant, with an additional cyclic constraint at the edges. Gray's review, Chapter 3, uses this first-row convention.
The wrap entry changes the calculation
Consider a deliberately simple, dimensionless cyclic filter:
C=201120012,x=124,Cx=489.
The rule is yi=2xi+x(i+1)mod3. The last output is 2×4+1=9: the filter comes back to the start. Replacing the lower-left entry by zero produces an upper-triangular Toeplitz filter with last output 8. That single corner entry encodes a different boundary assumption.
For chronological market observations, this particular rule already uses the next observation in its interior. It is an offline toy, not an implementable trading signal. Wrapping the last observation to the first also joins the endpoints of the sample; a causal filter over finite history needs its own time direction and boundary treatment.
A dimensionless cyclic filter with rows 2, 1, 0; 0, 2, 1; and 1, 0, 2 maps input (1, 2, 4) to (4, 8, 9). Removing its lower-left wrap entry changes the last output to 8. Its eigenvalues are 3 and 1.5 plus or minus 0.866i.
Original toy filter. The blue corner entry creates the wrap. The complex-plane plot uses equal scales and rounds the imaginary parts to three decimals.
Why Fourier modes work
Set ω=e−2πi/n, where i2=−1. For k=0,…,n−1, define the unit-length eigenvector and its eigenvalue by
vj(k)=nωkj,λk=r=0∑n−1crωkr.
To see the mechanism, substitute j=i+r modulo n into the matrix product. Periodicity gives
(Cv(k))i=nωkir=0∑n−1crωkr=λkvi(k).
Thus the eigenvalues are the negative-exponent discrete Fourier transform of the first row. With U containing these vectors as columns,
C=Udiag(λ0,…,λn−1)U∗,
where U∗ is the conjugate transpose. All circulants of the same size share this basis. A system Cx=b can therefore be solved in that basis by dividing each coordinate by its eigenvalue, provided every eigenvalue is nonzero. Small eigenvalue magnitudes can amplify input error during division. These statements follow from Gray's Fourier diagonalisation and Theorem 3.1.
For our matrix, λk=2+ωk, so the ordered values are
λ0=3,λ1=23−23i,λ2=23+23i.
The constant input (1,1,1)T is multiplied by 3, the row sum. The other modes form a complex conjugate pair. Real inputs still give real outputs because C itself has real entries.
Fast arithmetic needs the right convention
A fast Fourier transform computes the transforms in O(nlogn) operations, rather than a general dense matrix product's O(n2). A circulant only needs n stored coefficients. Multiplication is cyclic convolution, as explained in Strang's MIT lecture on circulants.
Check whether a formula or software routine takes a first row or first column: SciPy's circulant constructor takes a first column. For the conventional convolution rule yi=∑jajx(i−j)modn, use the first column aj=c(−j)modn. In this example that column is (2,0,1)T. Confusing it with (2,1,0) reverses the filter's direction. NumPy documents its negative-exponent DFT convention. Changing the exponent sign consistently reorders the modes; changing only one convention breaks the calculation.
Finally, circulant does not mean covariance. Our C is not symmetric and cannot be a real covariance matrix. For a real circulant covariance candidate, require symmetry, cr=cn−r for r=1,…,n−1, and nonnegative eigenvalues: the positive semidefinite requirement. Fast diagonalisation does not validate a covariance model or justify joining a time series' endpoints.
For a finance application of the same transform machinery, Fourier Transform Pricing develops the DFT and FFT before option-pricing transforms. The full lesson requires membership; a public preview is available.