QR decomposition by Givens rotations Created 2026-09-24 Updated 2026-10-14
Successive Givens rotations eliminate entries below the diagonal of a matrix. For an matrix with , process columns ; within column , rotate rows for each whose entry needs elimination. Apply each Givens row-pair update to columns . Both rows are zero in earlier columns, so these operations preserve earlier eliminations. No assumption of full column rank is needed to perform the eliminations.
For a concrete example, take
First use , then :
The entry in position was already zero, so its elimination was skipped. The second Givens rotation combines the remaining pair in column two. This yields the full QR decomposition
The first two columns of and first two rows of give the reduced QR decomposition. Direct multiplication verifies both and . For these displayed factors evaluated in binary64 floating-point arithmetic, the Frobenius norms and are both below ; these measure reconstruction and loss of orthogonality separately.
Figure 1.
Two local Givens row-pair updates turn a matrix into the rectangular of a QR decomposition
. Details.
More generally, if the chronological rotations are , then
Each factor is an orthogonal matrix, so is too. For a rectangular matrix, has zeros below its diagonal; its leading block is an upper triangular matrix. With full column rank, retaining the first columns of gives orthonormal columns. To impose a positive diagonal when necessary, flip matching columns of and rows of , preserving their product.
For a linear least-squares problem, apply the same chronological Givens rotations to the right-hand side , obtaining , without explicitly constructing . Since the Euclidean norm is preserved, solve the leading upper triangular matrix system by back substitution when has full column rank; the remaining entries of give the minimum residual norm. In the example, gives , , and minimum residual Euclidean norm .
The locality is useful for a sparse matrix or an existing QR decomposition needing an extra row: only two rows change at each step, and the new row can be eliminated against the stored upper triangular matrix. For an factor, this extra-row procedure takes rotations and arithmetic operations. Locality does not guarantee preservation of sparsity: mixing rows can create nonzeros wherever either row had one. For a fully populated input, the straightforward elimination uses rotations, each touching columns, giving work. Storage layout, zero patterns and implementation affect speed; this count alone establishes no universal advantage over other QR decomposition algorithms.
The Euclidean norm preservation explains the appeal for numerical stability: exact rotations do not amplify a perturbation's length. Rounded coefficients and Givens row-pair updates still introduce roundoff error. Small reconstruction and orthogonality residuals check the computed factors, while the condition number of the original problem still controls how accurately a linear least-squares problem determines its solution.
Quadratic lower bound for a nonsymmetric matrix Created 2026-10-18 Updated 2026-10-25
Let be a real square matrix and suppose for every real vector , with . The Cauchy-Schwarz inequality gives , hence for all . In particular the kernel is zero, so is an invertible matrix. Applying the bound to gives the operator norm estimate in the Euclidean norm.
Symmetry of is unnecessary: for its symmetric part of a matrix . Thus the hypothesis is exactly a positive lower bound on that symmetric matrix, even when the antisymmetric part is nonzero.
Rayleigh distribution Created 2026-10-06 Updated 2026-10-18
The Rayleigh distribution is the probability distribution of the Euclidean norm of a two-dimensional random vector with independent zero-mean normal random variables of equal variance as components. If are independent, then
Here is the standard deviation of each component, not of the radius . At this gives the unit-scale probability density function .[ref]
This geometry turns two signed errors into one nonnegative distance. For example, suppose horizontal and vertical positioning errors are independent random variables. Their means both vanish, but the distance from the intended point is usually positive. The Rayleigh distribution with gives the probability of landing inside any centered disk. These are chosen model assumptions, rather than measurements of a particular instrument.
Figure 1.
The center maximizes planar density, while a positive radius maximizes radial density
. Original calculated model with . Left: joint probability density per unit area, with an annulus from to . Right: probability density function per unit radius; the shaded area is the probability of that same annulus. A single point and a single circle both have probability zero. Details.
An apparently paradoxical feature is that the most likely location per unit area is the origin, while the radial mode is . A narrow annulus farther out has more area. Near zero that growing circumference outweighs the falling planar density; farther out the exponential function wins. Distinguishing densities measured against different elements of area or length resolves the paradox.
The linear-system residual is computable without knowing . The forward error is the actual difference from the desired solution. For an invertible matrix,
Keeping fixed, the approximate vector exactly solves with . Thus, for , is the relative backward error when only the right-hand side may change. For a vector norm and its induced operator norm,
A small relative linear-system residual ensures a small relative forward error when the condition number is moderate; an ill-conditioned matrix can amplify it. The bound follows directly from and .[ref]
For the Jacobi iteration for a three-variable tridiagonal system, the first linear-system residual is , while the first forward error is . In the Euclidean norm, the relative forward error is and the relative linear-system residual is . Its spectral condition number of a positive-definite matrix is , so the bound is about . The bound is a guarantee, not an equality. In floating-point arithmetic, recompute the linear-system residual from the current vector when checking termination; a small update alone need not certify a small forward error.
Right preconditioning 2026-10-18
Right preconditioning substitutes into the linear system . Applying its transformed linear map first solves , then computes . Recover the solution by solving . Its linear-system residual is exactly the original linear-system residual , which is useful when monitoring the imbalance in the original equations.
The left preconditioning and right preconditioning transformed matrices are similar matrices:
They therefore have the same eigenvalues, although their Euclidean norm condition numbers and residual histories need not agree. A similarity transformation preserves eigenvalues; a nonorthogonal change of coordinates need not preserve lengths.
Right singular vector Created 2026-10-05 Updated 2026-10-25
A right singular vector is a unit vector in the input space satisfying . For positive singular values, determines the matching left singular vector. In the ellipse example, is not parallel to : a right singular vector need not be an eigenvector of . Indeed, the characteristic polynomial of is , with eigenvalues and no real eigenvectors. Nevertheless, its real right singular vectors give a complete orthonormal basis. Eigenvectors describe preserved directions; right singular vectors describe orthogonal input channels of stretching.[ref]
An arbitrary input mixes these channels. For , orthogonality gives , while . Equal contributions, , produce output Euclidean norm from a unit vector. Concentrating the entire input along produces the maximum . This is why the right singular vectors give a direct reading of how any input will behave. For a compact operator, the same definition describes the positive terms of its singular value system.
Rotation matrix Created 2026-09-24 Updated 2026-10-14
A rotation matrix turns vectors while preserving their shape relationships. For column coordinate vectors in an orthonormal basis, its defining conditions are
where is the transpose and the identity matrix. In the usual Cartesian basis of the plane, an active counterclockwise planar rotation through an angle uses
Here the vector moves and the basis stays fixed: . Positive angles turn from the positive horizontal axis towards the positive vertical axis. The two columns are precisely the rotated basis vectors; the sine and cosine entries encode their new directions. Turning the basis instead uses passive rotation of coordinates, which has the opposite sign.
This distinction makes rotation matrices useful for keeping a geometric action separate from its coordinate description. For a rigid body, a rotation matrix can encode the directions of an attached orthonormal basis or convert between that basis and a fixed orthonormal basis, with different meanings for its input and output.[ref]
The orthogonal matrix condition preserves every dot product:
Consequently Euclidean norms and angles between nonzero vectors are preserved, as is the Euclidean norm of the difference between any two endpoints. The additional determinant condition preserves orientation of a vector space and oriented volume: for any square matrix whose columns are the input vectors, . An orthogonal matrix of determinant , such as a reflection matrix, preserves dot products but reverses orientation of a vector space. The matrix inverse is especially simple: .[ref]
The second-order central difference approximation to the fixed-end wave equation on interior points has normal modes
Here and the endpoint displacements are zero. The eigenvectors form an orthonormal basis in the ordinary Euclidean norm, without an extra grid-spacing weight. They sample the continuous standing wave shapes exactly, while their angular frequencies differ from because of spatial discretization. For fixed , the difference tends to zero as .
For real matrices, orthogonal similarity is the special case with an orthogonal matrix. Then a symmetric matrix remains symmetric, because . The expression describes the reverse conversion and has the same property. An orthonormal basis retains the ordinary dot product formula for its coordinate vectors.
An arbitrary change of basis need not preserve entrywise symmetry. In the opening example, is a symmetric matrix but is not. The geometric inner product has not disappeared: in the new coordinates it is represented by the Gram matrix
For with new coordinate vector , the squared Euclidean norm is , agreeing with . The naive coordinate sum would use the wrong inner product.
If , direct multiplication gives
This is self-adjointness expressed in the new inner product, rather than entrywise symmetry relative to the identity matrix. For the example, both products equal . Thus arbitrary matrix similarity preserves the linear operator, while its geometric interpretation requires transforming the Gram matrix as well. Matrix congruence supplies the corresponding rule for a bilinear form and should be distinguished from matrix similarity.
Singular matrix Created 2026-09-29 Updated 2026-10-18
An square matrix over a field, with , is singular when it has no matrix inverse. Geometrically, its linear map loses at least one input direction: some nonzero vector satisfies , so . Over the real numbers, the following family makes that loss visible:
Figure 1.
Compression by becomes collapse only at
. The square retains two-dimensional extent for and , but maps to a segment at . The orange points come from three inputs with the same first coordinate and different second coordinates. They coincide only at . This is exact illustrative geometry, not measured data. Details.
For this diagonal matrix, . Whenever , the input can be recovered as and the kernel is . At , the kernel becomes : the entire second coordinate is forgotten. Consequently has no solution if , and has the solution straight line , , if . A singular matrix therefore need not make a particular linear system inconsistent; it prevents unique recovery when that linear system is consistent.
For an square matrix, all these tests describe the same failure:
Here is the field of scalars. Equivalently, the columns are linearly dependent, the linear map is neither injective nor surjective, and some outputs cannot be reached. See the invertible matrix equivalences and Strang's MIT 18.06SC lecture summary, Multiplication and inverse matrices, p. 2. Over an infinite field, every consistent linear system for a singular matrix has infinitely many solutions; over a finite field with elements and nullity , it has exactly solutions. This follows by adding each kernel vector to one solution.
The square hypothesis is essential. For an matrix, injectivity means matrix rank (full column rank), whereas surjectivity means matrix rank (full row rank). A rectangular matrix can satisfy one condition without the other; its kernel and image of a linear map give the useful tests without calling it a singular matrix.
Exact singularity also differs from sensitivity. For , is an invertible matrix, but its smallest singular value is and its condition number in Euclidean norm is . A change changes the recovered input by : with and , an output change of causes an input change of . These are exact toy values, not measurements. The condition number quantifies this sensitivity before a direction is lost; see Steve Marschner, Condition numbers, §2. A small determinant alone is not a reliable sensitivity test: has determinant yet condition number one for every nonzero real , since both singular values shrink equally.
Singular value Created 2026-09-24 Updated 2026-10-14
The singular values of a matrix measure stretching of Euclidean norm. They are the nonnegative square roots of the eigenvalues of , counting the diagonal slots of the singular value decomposition; when , has additional zero eigenvalues. Nonnegativity follows from , so is a positive semidefinite matrix. For the preceding matrix,
Both have eigenvalues , giving singular values . In particular,
Here the operator norm uses Euclidean norm: no unit vector stretches more than fivefold. Zero singular values identify lost directions; the number of positive singular values equals the matrix rank. This summarizes both amplification and information loss with nonnegative numbers.[ref]
Small positive singular values also explain sensitivity in an inverse problem. For a square invertible matrix, the matrix inverse sends to : a weak forward response becomes strong inverse amplification. The condition number for Euclidean norm is , equal to in our example. To see a larger effect, keep the same right singular vectors but change the second singular value to :
The output perturbation has Euclidean norm , but the recovered input changes by . Its hundredfold amplification follows from the direction of the perturbation, not just its size. The condition number is now ; it measures the disparity between the strongest and weakest responses.[ref]
For a nonzero matrix , the operator norm induced by the Euclidean norm satisfies , where is its smallest positive singular value. The singular value decomposition makes the danger visible: a small nonzero stretch becomes a large amplification of errors when inverted.
For instance, when ,
A data perturbation changes the reconstructed input by . At , however, the pseudoinverse is : exactly zero and merely small are different cases. Thus the pseudoinverse need not be continuous across a change of matrix rank. With uncertain data, truncated singular value decomposition or Tikhonov regularization can trade exact inversion of weak directions for stability; the cutoff or penalty adds a modelling choice.
Suppose has a fixed point and with diagonal . For and , subtraction gives . In the Euclidean norm,
Thus . Spectral radius below one implies convergence for every start. The unit-constant bound belongs to the transformed coordinates; it does not automatically hold in the original Euclidean norm when is nonorthogonal.
Squared Euclidean norm Created 2026-10-06 Updated 2026-10-20
For a real vector , the square of its Euclidean norm is . Unlike the norm itself it is a quadratic function, so expanding sums directly exposes diagonal and cross terms. This is useful for the mean-square displacement of an isotropic planar random walk.
Square of a number 2026-10-14
The square of a number is the product . For a real number, it is nonnegative. The sum of squares of real coordinates is the squared Euclidean norm of the corresponding vector.
For finite real numbers , a Givens rotation that annihilates is defined mathematically by
Here hypot means an evaluation of the Euclidean norm of designed to avoid unnecessary range failures in floating-point arithmetic. The zero case selects the identity matrix, avoiding division by zero. If , then ; if , then . Thus the retained component is nonnegative, including when . In exact arithmetic, and .
Computing the square root of a*a + b*b directly can fail even when the final norm is representable. In binary64 floating-point arithmetic, makes the squares overflow, whereas is finite. With the squares round to zero, although is representable. A range-safe hypot avoids these intermediate failures.
The simple divisions still need care when is a subnormal number: rounding can cause large relative errors. For the smallest positive binary64 subnormal number , taking rounds to ; dividing by that rounded value gives , which is not an orthogonal matrix. For nonzero finite inputs, compute the coefficients before rescaling the norm:
At least one scaled component has absolute value one, and . This construction keeps the coefficients meaningful even when rounding is severe. It cannot make an unrepresentably large finite, preserve an arbitrarily tiny against underflow, or repair inputs already rounded to zero. The row updates themselves can also overflow if their exact results exceed the available range.
LAPACK's DLARTG uses scaling for numerical stability but a different sign convention: for it chooses and ; for it returns . Its block still has the lower-left minus sign. Do not combine its returned coefficients with an assumed nonnegative .[ref]
On the graph of a function , assume is differentiable, its planar gradient is nonzero, and speed is measured by the three-dimensional Euclidean norm. The upward unit normal vector is . Projecting the downward vertical vector onto the tangent plane gives . By the Cauchy-Schwarz inequality, normalizing this projected vector produces the tangent direction with greatest height decrease at the prescribed speed, giving the displayed velocity. Its vertical component is , and its horizontal direction is parallel to . Consequently its planar paths agree with negative gradient flow up to a change of time, although the speeds differ. Where , every tangent direction has zero first-order height change and this normalized formula is undefined.
For an unbiased stochastic gradient at with finite conditional second moment, expand in the squared Euclidean norm. The cross term has zero conditional expectation, which proves the displayed identity. It separates the squared true gradient from the total conditional variance of its random estimate.
Target: gradient-descent.bigb, under Stochastic gradient descent.
Sub-Gaussian random vector Created 2026-10-06 Updated 2026-10-14
A centered random vector is sub-Gaussian with variance proxy when the displayed inequality holds for every deterministic vector . Equivalently every scalar inner product is a sub-Gaussian random variable with proxy . Independence of coordinates is not required. For vectors with Euclidean norms at most one, the union bound gives with probability at least . This assumption alone is weaker than concentration for all Lipschitz functions.
Sum of squares 2026-10-13
A sum of squares adds the squares of numbers for specified real numbers . It is nonnegative and vanishes exactly when every term is zero. For the coordinates of a vector, it is the squared Euclidean norm; for regression residuals, it gives the residual sum of squares minimized by ordinary least squares.