All formulas

Linear algebra

Frobenius norm

linalg.frobenius-normAlso called frobenius norm, frobenius, fro norm, matrix norm

∥A∥F=∑i=1m∑j=1nAij2\|A\|_F = \sqrt{\sum_{i=1}^{m}\sum_{j=1}^{n} A_{ij}^2}

Square root of the sum of the squared entries of a matrix.

Notation

AA

matrix

A ∈ ℝm×n

mm

rows

Size, at least 1

nn

columns

Size, at least 1

∥A∥F\|A\|_F

Result: the norm

scalar

Worked examples

Each result is solved exactly and confirmed by two independent computations.

  1. Given

    A=[[1,2],[3,4]]A = \left[\left[1, 2\right], \left[3, 4\right]\right]

    Result

    ∥A∥F=30\displaystyle \|A\|_F = \sqrt{30}

    ≈ 5.47722557505

  2. Given

    A=[[3,0,0],[0,4,0]]A = \left[\left[3, 0, 0\right], \left[0, 4, 0\right]\right]

    Result

    ∥A∥F=5\displaystyle \|A\|_F = 5
  3. Given

    A=[[1]]A = \left[\left[1\right]\right]

    Result

    ∥A∥F=1\displaystyle \|A\|_F = 1

Common mistakes

  • Returns the spectral norm

    The result is the largest singular value (the matrix 2-norm, numpy.linalg.norm(A, 2)).

    Fix: Use numpy.linalg.norm(A, 'fro'), or the square root of the sum of squared entries.

  • Returns the squared norm

    The final square root is missing.

    Fix: Take the square root.

Source

  • Golub and Van Loan 2013

    Golub, Gene H.; Van Loan, Charles F. Matrix Computations. 4th ed. Johns Hopkins University Press, 2013.