Linear least squares 2026-10-13
Linear least squares minimizes over a vector . Its normal equations for linear least squares are ; geometrically is the orthogonal projection of onto the range of .
Linear least-squares projection Created 2026-09-24 Updated 2026-10-14
This is an orthogonal projection interpretation of linear least squares. The best affine predictor has slope covariance divided by predictor variance and intercept chosen to match means.
Orthogonal projection onto a finite-dimensional subspace Created 2026-09-24 Updated 2026-10-14
A finite-dimensional linear subspace of an inner product space has a unique closest vector to any given vector . This is its orthogonal projection . If is an orthogonal basis of , compute it one direction at a time:The inner product convention here is linear in its first argument, including over the complex numbers. For an orthonormal basis, each denominator is one. When consists only of the zero vector, the empty sum gives . The finite-dimensional formula is described in Francis Narcowich, Inner Products and Norms: minimization problems.
Take and , using the dot product. With ,The orthogonal projection residual has . To verify the best approximation directly, every candidate in the line is , andThe smallest squared Euclidean norm error is therefore , attained only at . The diagram connects the perpendicular residual to this one-variable quadratic polynomial.
The perpendicular residual identifies the closest point on a line and the unique minimum of the squared error
. Details. The general mechanism is the Pythagorean theorem in an inner-product space. For any , the vectors and are orthogonal, soMoving away from inside adds a nonnegative squared norm, which is zero only when . This proves both optimality and uniqueness.
The useful feature is separation of preparation from evaluation. Construct an orthonormal basis once with the Gram-Schmidt process, then obtain each new best approximation using inner products instead of a fresh optimization problem. When is the column space of a matrix, this gives linear least squares; when is spanned by orthogonal polynomials, it gives a least-squares polynomial in an orthogonal-polynomial basis. The ambient inner product space need not be a Hilbert space for this finite-dimensional construction. In an infinite-dimensional target linear subspace, existence requires additional hypotheses, supplied by orthogonal decomposition by a closed subspace.
Polynomial interpolation Created 2026-09-24 Updated 2026-10-14
Polynomial interpolation constructs a polynomial that passes exactly through prescribed data. Given distinct interpolation nodes and values , there is exactly one interpolation polynomial of polynomial degree at most with for every . The values may be samples of a function, but no knowledge of that function between the interpolation nodes is needed to construct . The Lagrange polynomial and Newton polynomial are two representations of this same answer.[ref]
For example, the three data points give the quadratic polynomialThus polynomial interpolation supplies as an intermediate value. Whether this approximates an unknown underlying function well is a separate question about polynomial interpolation error.
Both hypotheses in the uniqueness statement matter. The Lagrange cardinal polynomials prove existence constructively. If two polynomials of polynomial degree at most fit the data, their difference has distinct roots of a polynomial, so it must be zero. Repeated interpolation nodes with conflicting values have no solution, and repeated equal values provide no additional independent condition; prescribed derivatives instead lead to Hermite interpolation. Without the polynomial degree restriction there are infinitely many solutions:where is any polynomial. By the factor theorem, this describes every polynomial fitting the same data. In the example, fits for every , but at its value is ; exact agreement at the three interpolation nodes alone says nothing about that intermediate value.
The usefulness of polynomial interpolation is that data become an explicit function whose values, derivatives, and integrals can be calculated. Differentiating or integrating the Lagrange cardinal polynomials produces differentiation weights from nodal evaluations or a quadrature rule. Exact passage through observations is the defining constraint. In polynomial regression, linear least squares instead chooses a polynomial degree and minimizes a sum of squared residuals, generally without passing through every observation. Interpolating noisy values reproduces their errors at the interpolation nodes and can amplify them between interpolation nodes; polynomial interpolation does not itself smooth measurement noise. A linear least squares problem with distinct interpolation nodes and polynomial degree at most does happen to attain zero residual at the same interpolation polynomial.
