Prerequisites
Vectors, dot products, matrix transposes, and derivatives of quadratics.
Learn first
An observation and its model prediction
A model prediction is an expected value under a stated rule. A residual records the difference between an observed value and the prediction.
How to work it out When the requested convention is observed minus predicted, subtract the model prediction from the observation. A residual can be positive, zero, or negative.
A separate example For a separate observation of 17 with prediction 20, the residual is 17 − 20 = −3. The sign shows the observation is below the prediction.
Powers and exponents
An exponent tells how many equal factors are multiplied. A square uses two factors; a cube uses three. An exponent does not mean multiply the base by the exponent.
How to work it out For powers with the same base, multiplication adds exponents. Apply parentheses and exponents before ordinary multiplication and addition.
A separate example In a separate example, 3⁴ = 3 × 3 × 3 × 3. Also 3² × 3⁴ = 3⁶ because there are six factors of 3.
Letters stand for numbers
A variable is a letter standing for a number. An expression describes a calculation. An equation says two expressions are equal. A solution makes the equation true.
How to work it out Substitute given values into expressions. To solve an equation, undo operations while doing the same thing to both sides. Check by substitution.
A separate example For the separate equation 4x + 1 = 21, subtract 1 from both sides, then divide by 4. Checking x = 5 gives 21 on both sides.
Minimize the squared residual norm ||Ax - b||^2. Differentiating gives A^T(Ax - b) = 0: the residual is orthogonal to the column space. Full column rank gives a unique coefficient vector; a fitted vector can remain unique without unique coefficients.
Worked example
For b = (1, 5) and A = (1, 1)^T, the best constant is 3. The residual b - Ax = (-2, 2) sums to zero, so it is perpendicular to A.
Model and Assumptions
Fit one constant x to invented observations b = (1, 2, 6). A is a three-by-one column of ones. Give all observations equal weight and define the residual as r = b - Ax.
Further inquiry
Derive the normal equations for a general real matrix. Then replace A with two identical columns of ones: describe all minimizing coefficient pairs and prove that their fitted vectors agree.
Review criteria
- Differentiate or complete the square explicitly.
- Give the coefficient family and identify its null direction.
- Distinguish uniqueness of the projection from uniqueness of coefficients.