Skip to content
Glacius
Linear algebraConcept reference

Frobenius norm

The Frobenius norm is the square root of the sum of squared real matrix entries.

On this page 9 sections
  1. Overview
  2. To compare two matrices, subtract matching entries
  3. A norm is not a sum of absolute entries
  4. For an approximation error, first form the residual matrix
  5. The same calculation measures how well a truncated SVD reproduces a data matrix
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01To compare two matrices, subtract matching entries#

To compare two matrices, subtract matching entries. You now have a matrix of errors, but often need one number describing their total size. The Frobenius norm treats all those entries like coordinates in one long vector and takes its Euclidean length.

Squaring makes positive and negative errors both contribute. Taking a square root returns the result to the original units. An image difference, for example, becomes a single aggregate pixel-error magnitude; the norm alone does not tell you where the errors occur.

The Frobenius norm treats all entries as one long vector. Square every entry, add all the squares, and take the nonnegative square root.

AF=i,jAij2\|A\|_F=\sqrt{\sum_{i,j}A_{ij}^2}

For rows (1,2);(2,4)(1,-2);(2,4), the squares total 1+4+4+16=251+4+4+16=25. The norm is 25=5\sqrt{25}=5.

Matrix rows (1,-2);(2,4) become squared entries (1,4);(4,16). Their sum is 25 and the Frobenius norm is 5.Matrix rows (1,-2);(2,4) become squared entries (1,4);(4,16). Their sum is 25 and the Frobenius norm is 5.
Figure 1Matrix rows (1,-2);(2,4) become squared entries (1,4);(4,16). Their sum is 25 and the Frobenius norm is 5.
Link to this figure ↗Download SVGDownload PNG

For error rows (1,2);(2,0)(1,-2);(2,0), visit all four entries: their squares are 1,4,4,01,4,4,0. Add to get 9, then take the square root to get 3. Stopping at 9 reports the squared norm. Adding the original entries would let signs cancel and would miss the size of the error.

Check your reasoning

Matrix rows (2,4)(2,-4); (4,0)(4,0). Give its Frobenius norm.

Show answer and explanation
6

Squared entries total 3636; norm 66.

02A norm is not a sum of absolute entries#

A norm is not a sum of absolute entries. For the single row (3,4)(3,-4), the absolute sum is 7, but squared entries total 25, giving norm 5. Off-diagonal entries count just like diagonal entries.

Check your reasoning

Matrix rows (0,3)(0,3); (4,0)(4,0). Claimed Frobenius norm 77. Repair.

  1. A7
  2. B5
  3. C25
Show answer and explanation
5

Squared entries total 2525; norm 55.

03For an approximation error, first form the residual matrix#

For an approximation error, first form the residual matrix. If AA has rows (4,2);(1,3)(4,2);(1,3) and BB has rows (1,2);(1,1)(1,2);(1,-1), the residual rows are (3,0);(0,4)(3,0);(0,4), with norm 5.

Check your reasoning

Rows AA: (4,2)(4,2); (1,5)(1,5). Rows BB: (2,1)(2,1); (1,3)(1,3). Give ABF\|A-B\|_F.

Show answer and explanation
3

Residual rows (2,1)(2,1); (0,2)(0,2); norm 33.

04The same calculation measures how well a truncated SVD reproduces a data matrix#

The same calculation measures how well a truncated SVD reproduces a data matrix. Every entry is weighted equally here. If features use very different units or some pixels matter more, that modeling choice needs attention before interpreting this total as practical quality.

Key takeaway

Square every entry, add all the squares, and take the nonnegative square root. For an error norm, subtract the matrices first.

  • Compute a matrix's Frobenius norm.

Further questions

Can an SVD give approximation error without rebuilding every entry?
Yes. For a leading-component truncation, the Frobenius error is the square root of the sum of discarded singular-value squares.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Frobenius norm.” Math behind ML. /learn/la-frobenius