Search

Search papers and lessons

Hankel Matrix

Level 2 · 10 min read

A Hankel matrix is a grid built from one sequence of numbers where every anti-diagonal holds the same value, so its rank reveals how many steps back the sequence depends on.

On this page

  • Colour = topic mix
  • Discrete math
  • Linear algebra
  • ReadReady to readNot yet

TL;DR

A Hankel matrix is a grid of numbers built from a single sequence, where each entry depends only on the sum of its row and column numbers, so the same value runs along every anti-diagonal. Its rank counts how many independent patterns the sequence contains, which is why it is a standard tool for finding hidden structure in measured data.

Builds on: Matrix, Sequence · Leads to: System Identification, Willems' Fundamental Lemma

Where it's used

Finding the order of a system. An engineer records the response of a machine, such as a motor or a bridge, to a short kick. The recorded values form a sequence, and a Hankel matrix built from it reveals how many internal states the system has. This is the core step in System Identification, where the rank of the matrix gives the order of a Linear Dynamical System.

Time-series analysis. Singular spectrum analysis, a method used on climate and economic data, stacks shifted windows of a series into a Hankel matrix and takes its singular values. The large values separate the trend and the seasonal cycles from the noise.

Data-driven control. Recent methods in control use Hankel matrices of recorded input and output data instead of an explicit model. Willems' fundamental lemma says that, under conditions, the columns of such a matrix span every possible short trajectory of the system, so a controller can be designed directly from the recordings.

How it works

Start with a sequence of five numbers, s1=1s_1 = 1, s2=2s_2 = 2, s3=3s_3 = 3, s4=4s_4 = 4, s5=5s_5 = 5. Each step adds one idea.

  1. Choose the size. Use a 3 by 3 matrix. Its entries will come from the sequence, and the rule is Hij=si+j−1H_{ij} = s_{i+j-1}, where ii is the row and jj is the column. Check: the largest index used is 3+3−1=53 + 3 - 1 = 5, which is in the sequence.

  2. Fill the first row. Row 1 uses i=1i = 1: the entries are s1,s2,s3s_1, s_2, s_3, which are 1,2,31, 2, 3. Check: the first row starts with the first number of the sequence.

  3. Shift for each new row. Row 2 uses i=2i = 2: the entries are s2,s3,s4s_2, s_3, s_4, which are 2,3,42, 3, 4. Row 3 gives 3,4,53, 4, 5. Check: each row is the one above it shifted one place to the left.

  4. Notice the anti-diagonals. Put the three rows together:

    H=(123234345)H = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 3 & 4 \\ 3 & 4 & 5 \end{pmatrix}

    Along the anti-diagonal from the top right to the bottom left, all three entries are 3. Check: the entries (1,3)(1,3), (2,2)(2,2) and (3,1)(3,1) all have i+j=4i + j = 4, and each equals s3=3s_3 = 3.

  5. Count the independent rows. Row 3 equals 2×row 2−row 12 \times \text{row 2} - \text{row 1}: indeed 2×(2,3,4)−(1,2,3)=(3,4,5)2 \times (2, 3, 4) - (1, 2, 3) = (3, 4, 5). So only two rows are independent, and the rank is 2. Check: the rank is 2 because the sequence follows a rule that uses the two previous values, sn+2=2sn+1−sns_{n+2} = 2 s_{n+1} - s_n.

01234560123456position nvalue s_n
  • sequence s_n
The five values of the sequence. They lie on one straight line, which is why the Hankel matrix has rank 2 instead of 3.

The math

Definition: Hankel matrix

Given a sequence s1,s2,…,sNs_1, s_2, \dots, s_N, the mm by nn Hankel matrix has entries Hij=si+j−1H_{ij} = s_{i+j-1} for row ii from 1 to mm and column jj from 1 to nn, where m+n−1≤Nm + n - 1 \le N. Every entry depends only on i+ji + j, so it is constant along each anti-diagonal. A square Hankel matrix is symmetric: HT=HH^{\mathsf{T}} = H.

Step 1 in symbols

For a 3 by 3 matrix, the largest index is i+j−1=3+3−1=5i + j - 1 = 3 + 3 - 1 = 5, so five values of the sequence are used. This is why m+n−1≤Nm + n - 1 \le N must hold.

Step 2 in symbols

Row i=1i = 1 has H1j=sjH_{1j} = s_j, so the first row is (s1,s2,s3)=(1,2,3)(s_1, s_2, s_3) = (1, 2, 3).

Step 3 in symbols

Moving down one row shifts the window one place along the sequence: Hi+1,j=Hi,j+1H_{i+1,j} = H_{i,j+1}. This is the defining shift property. For example, H2,1=s2=H1,2H_{2,1} = s_2 = H_{1,2}.

Step 4 in symbols

Entries with the same i+ji + j are equal, because each equals si+j−1s_{i+j-1}. On the anti-diagonal i+j=4i + j = 4 the value is s3=3s_3 = 3. Because HijH_{ij} depends only on i+ji + j, the matrix is symmetric: swapping ii and jj leaves the sum unchanged.

Step 5 in symbols

The rank is the number of independent rows. Here row3=2 row2−row1\text{row}_3 = 2\,\text{row}_2 - \text{row}_1, so the rank is 22. If a sequence obeys a linear recurrence of order pp, meaning sn+p=a1sn+p−1+⋯+apsns_{n+p} = a_1 s_{n+p-1} + \dots + a_p s_n for fixed numbers aka_k, then for large enough Hankel matrices the rank is at most pp. Here p=2p = 2 with a1=2a_1 = 2 and a2=−1a_2 = -1.

Worked examples

Example
1. A tiny case: a 2 by 2 Hankel matrix
  1. Take the sequence s1=5s_1 = 5, s2=7s_2 = 7, s3=9s_3 = 9.
  2. A 2 by 2 Hankel matrix uses Hij=si+j−1H_{ij} = s_{i+j-1}, so H11=s1=5H_{11} = s_1 = 5, H12=s2=7H_{12} = s_2 = 7.
  3. Row 2 is H21=s2=7H_{21} = s_2 = 7 and H22=s3=9H_{22} = s_3 = 9.
  4. The matrix is (5779)\begin{pmatrix} 5 & 7 \\ 7 & 9 \end{pmatrix}.
  5. Interpretation: the matrix is symmetric, and its two entries on the anti-diagonal are both 7.
Example
2. The standard case: squares
  1. Take the sequence of squares sn=n2s_n = n^2: 1,4,9,16,251, 4, 9, 16, 25.
  2. The 3 by 3 Hankel matrix is (149491691625)\begin{pmatrix} 1 & 4 & 9 \\ 4 & 9 & 16 \\ 9 & 16 & 25 \end{pmatrix}.
  3. Compute the Determinant: 1(9⋅25−16⋅16)−4(4⋅25−16⋅9)+9(4⋅16−9⋅9)1(9 \cdot 25 - 16 \cdot 16) - 4(4 \cdot 25 - 16 \cdot 9) + 9(4 \cdot 16 - 9 \cdot 9).
  4. Evaluate: 1(225−256)−4(100−144)+9(64−81)=−31+176−153=−81(225 - 256) - 4(100 - 144) + 9(64 - 81) = -31 + 176 - 153 = -8.
  5. Interpretation: the determinant is not zero, so the rank is 3. The squares satisfy a recurrence of order 3 (the third differences are constant), so rank 3 is the expected answer.
Example
3. A realistic case: a pure sinusoid

Sample a single-frequency signal at five times, so that sn=cos⁡(n−1)s_n = \cos(n - 1) for n=1,…,5n = 1, \dots, 5. The values are 1.0001.000, 0.54030.5403, −0.4161-0.4161, −0.9900-0.9900, −0.6536-0.6536. The 3 by 3 Hankel matrix starts with the rows (1.000,0.5403,−0.4161)(1.000, 0.5403, -0.4161) and (0.5403,−0.4161,−0.9900)(0.5403, -0.4161, -0.9900).

  1. A cosine satisfies sn+2=2cos⁡(1) sn+1−sns_{n+2} = 2\cos(1)\, s_{n+1} - s_n, with 2cos⁡(1)=1.08062\cos(1) = 1.0806.
  2. Apply it to the rows: 1.0806×(0.5403,−0.4161,−0.9900)−(1.000,0.5403,−0.4161)1.0806 \times (0.5403, -0.4161, -0.9900) - (1.000, 0.5403, -0.4161).
  3. Multiply out: the first entry is 0.5838−1.000=−0.41620.5838 - 1.000 = -0.4162, which matches cos⁡2=−0.4161\cos 2 = -0.4161 up to rounding, the entry at (3,1)(3,1).
  4. The second entry is −0.4497−0.5403=−0.9900-0.4497 - 0.5403 = -0.9900 and the third is −1.0698+0.4161=−0.6537-1.0698 + 0.4161 = -0.6537, matching the last row up to rounding.
  5. Interpretation: the third row is a combination of the first two, so the rank is 2. A single sinusoid needs only two numbers to describe its pattern.

Try it: the entry at (3,1)(3,1) must equal 1.0806×0.5403−1.0001.0806 \times 0.5403 - 1.000. What is its value? Answer: 0.5838−1.000=−0.41620.5838 - 1.000 = -0.4162, which matches cos⁡2=−0.4161\cos 2 = -0.4161 up to rounding.

Common mistakes and tradeoffs

Hankel and Toeplitz are the same. It is tempting to think a Hankel matrix is any matrix with equal diagonals. In fact a Hankel matrix is constant along anti-diagonals, where i+ji + j is fixed. A Toeplitz matrix, which has equal diagonals where i−ji - j is fixed, is a different shape of the same idea. Check which index sum or difference stays fixed before you name the matrix.

A low rank means something is wrong. It is tempting to think a Hankel matrix must have full rank. In fact a low rank is the useful signal: it says the sequence follows a short recurrence. Noisy data usually raises the rank, so methods look for a clear drop in the singular values.

The matrix must be square. It is tempting to think a Hankel matrix must be square. In fact it can be rectangular, as long as m+n−1m + n - 1 does not exceed the number of values in the sequence. Block Hankel matrices stack vector-valued samples and are used in control.

Use a Hankel matrix when your data is a sequence whose entries shift as you move along a window, such as recordings, time series or impulse responses. Do not use it when the entries are unrelated, since the structure would be false. For the rank to be meaningful, you need enough data: a matrix that is too small cannot reveal a long recurrence.

History

The matrices are named after the German mathematician Hermann Hankel, who studied their determinants in the 19th century. In 1966 Ho and Kalman showed that the Hankel matrix built from a system's impulse response leads to a state-space model of the system, and that the rank of that matrix gives the system's order. This made Hankel matrices a central tool in system identification, and later in data-driven control.

Recap

  • A Hankel matrix has Hij=si+j−1H_{ij} = s_{i+j-1}: constant along each anti-diagonal and symmetric when square.
  • Moving down a row shifts the window one place along the sequence.
  • The rank of a large Hankel matrix equals the order of the recurrence the sequence obeys.
  • A sinusoid gives a Hankel matrix of rank 2.
  • Next: System Identification uses this rank to find the order of a system, and Willems' Fundamental Lemma builds controllers from Hankel matrices of recorded data.

Check yourself

QuestionRecall: In a Hankel matrix, what stays the same along each anti-diagonal?Show answer

The entries stay the same, because Hij=si+j−1H_{ij} = s_{i+j-1} depends only on i+ji + j, which is constant along an anti-diagonal.

QuestionComputation: For the sequence s1=2s_1 = 2, s2=4s_2 = 4, s3=6s_3 = 6, s4=8s_4 = 8, write the 2 by 2 Hankel matrix and find its rank.Show answer

The matrix is (2446)\begin{pmatrix} 2 & 4 \\ 4 & 6 \end{pmatrix}. Its determinant is 2⋅6−4⋅4=−42 \cdot 6 - 4 \cdot 4 = -4, which is not zero, so the rank is 2. (Adding s5=10s_5 = 10 would give a 3 by 3 matrix of rank 2, because this sequence is arithmetic, as in the walkthrough.)

QuestionWhy: Why does a rank-2 Hankel matrix suggest that the sequence follows a two-step recurrence?Show answer

Rank 2 means the third row is a fixed combination of the first two, as in the walkthrough, where row 3 =2 = 2\,row 2 − -\,row 1. Read entry by entry, that row relation is sn+2=a1sn+1+a2sns_{n+2} = a_1 s_{n+1} + a_2 s_n with fixed numbers a1a_1 and a2a_2, so each new value is determined by the two before it.

QuestionApplied: A measured sequence gives a 5 by 5 Hankel matrix with singular values 10, 7.9, 0.02, 0.01 and 0.01. What is the best estimate of the system order?Show answer

The values drop sharply after the second one, so the signal is dominated by two directions. The best estimate of the order is 2. The small values near 0.01 to 0.02 are most likely noise.

Sources