Exact accounting identities are useful, but recorded costs can contain measurement error or omitted influences. Instead of forcing incompatible observations into an exact model, we can ask which model prediction is closest to them. Two questions must remain separate: whether the coefficients are identifiable, and whether the fitted predictions are accurate.
1 Span basis and a linear model
A subspace of contains zero and is closed under vector addition and real scalar multiplication. The span of vectors is the set of their linear combinations. Vectors are linearly independent if a zero linear combination forces every coefficient to be zero. A basis is an independent spanning list; its size is the dimension.
For , the map is linear because . Its image is the column space , the span of the columns. The model can predict exactly the vectors in this subspace. Its rank is .
Finite basis existence and extension, without a counting assumption
Let be a real vector space supplied with a finite spanning list . First prove that every independent list has length at most . After insertions, maintain a spanning list consisting of and surviving old vectors. Expand in this list. Some coefficient on a surviving old vector is nonzero; otherwise would be in the span of the earlier , contradicting independence. Solve for that old vector and replace it by . The new list spans the same space and keeps every earlier insertion. If , after steps the first independent vectors already span , contradicting independence of . This proves the bound, including .
Every subspace has a finite basis. Start with the empty independent list. If its current span is not , choose one vector of outside that span. A relation with nonzero coefficient on the new vector would express it in the old span, so the enlarged list remains independent. The proved bound permits at most additions; therefore the process stops with an independent spanning list for . If , it stops immediately with the empty basis. Starting instead with any given independent list in proves that list extends to a basis of . Only a bounded finite selection is used. Finally, if two bases have sizes , use each as the finite spanning list in the bound to obtain and . Thus basis size, called dimension, is well-defined. This supplies the existence, extension and dimension facts used in rank–nullity.
Apply the following result with , and .
A map is linear if . Its kernel and image are subspaces. Choose a basis of and extend to a basis with . Then form a basis of : spanning follows by expanding any input; a dependence among these images places the corresponding input combination in the kernel, and independence of the extended basis makes all coefficients zero. Thus
This is rank–nullity. In equal finite dimensions, injectivity and surjectivity are equivalent, but the equivalence can fail in infinite-dimensional spaces.
A coefficient vector is identifiable from its exact prediction precisely when . For example, if two explanatory columns are identical, their coefficients can trade off invisibly. More observations do not fix this when they repeat the same dependence.
Real inner products, their norms and the needed inequalities
An inner product on a real vector space is a map that is symmetric, linear in each argument, and positive definite: for . Linearity gives . Define . It is zero exactly at zero and satisfies . The standard example on is . Vectors are orthogonal when their inner product is zero, and a list is orthonormal when distinct members are orthogonal and each member has norm one.
If , insert into the nonnegative square . Expanding by bilinearity gives , hence . If the same inequality holds directly. Equality for means , equivalently ; the zero-vector cases also give equality. Finally expand and apply the bound to its cross term to obtain . Both sides to be square-rooted are nonnegative, so the triangle inequality follows. Thus this is a norm, and normalization of any nonzero vector divides by a positive real number. No complex bilinear convention is being used.
Orthonormal bases and extension while retaining prescribed vectors
Suppose in addition that has a real positive-definite inner product. On an independent list , define successively
Inductively the previous are orthonormal. For , taking the inner product with gives . If , then lies in the previous span, a contradiction. Division by its positive norm is therefore legal. The displayed formula and its rearrangement show that the first old and new vectors span the same space, completing the induction. Apply this to a basis to obtain an orthonormal basis, also for a subspace. To extend a prescribed orthonormal list, first extend it to an ordinary basis by the proved theorem and then apply this construction in that order. On the prescribed first vectors no component is subtracted and the norm is one, so every prescribed vector is retained exactly. Empty lists and the zero subspace require no division. This proves the orthonormal extension used in SVD and projection existence.
2 Orthogonal residuals and normal equations
The Euclidean inner product is , and . A least-squares solution minimizes over all real . Its residual is .
Theorem. A vector is a least-squares solution if and only if
These are the normal equations. If the columns of are independent, the solution is unique.
Proof. For any perturbation ,
If the normal equations hold, the last term is nonnegative, proving minimality. Conversely, take . A nonzero linear coefficient in this quadratic would allow a sufficiently small choice of of the opposite sign to decrease the objective. Thus all coordinates of vanish. If columns are independent, for , so is invertible and the normal equations have one solution.
Existence does not require independent columns: choose an orthonormal basis of the finite-dimensional column space, project onto that basis, and choose any coefficient vector representing that projection. Predictions are unique even when coefficients are not.
3 Worked cost estimation
Fit the simplified model to three observations . The intercept models a fixed component and the slope a variable component, but those interpretations require the model to be appropriate.
Subtracting the first normal equation from the second gives . Hence and . Predictions are and the residual is . Its sum and its dot product with are both zero, as the theorem predicts. Squared residual norm is .
A small residual does not prove causation, validate future extrapolation, or detect all omitted variables. A negative estimated fixed cost may indicate an unsuitable model or unsuitable data; unconstrained least squares does not enforce accounting constraints automatically. For numerical computation, QR or SVD avoids the conditioning penalty of explicitly forming .
4 Graded practice
E1 Foundation. Show is a subspace and find a basis.
E2 Computation. Fit to . Find the residual and its squared norm.
E3 Structure. If has columns with , describe all coefficients minimizing .
E4 Extension. Let have nonzero real diagonal entries and write the statistical weights as . Derive the equations for minimizing . Explain why the must be positive for a genuine weighted norm, while choosing is a square-root convention and nonzero of either sign give the same weights.
5 Full solutions
S1. The defining equation is homogeneous linear, so zero lies in and linear combinations preserve it. Every vector is . These two vectors are independent by their first two coordinates, hence form a basis.
S2. Here with the same as above. Subtraction gives , so and . The residual is , squared norm . It is perpendicular to both model columns.
S3. The prediction is . Projection onto the line spanned by gives the unique sum . Every minimizes the objective. The null direction explains coefficient nonuniqueness.
S4. Apply the normal-equation theorem to and : . Positive diagonal entries make invertible, so only when . A zero weight can erase a nonzero observation difference; a negative diagonal entry still gives the same squared positive weight after squaring, but is not the conventional positive square-root weight. The statistical meaning of a chosen weight requires separate assumptions.
Summary
Column spaces describe possible predictions; null spaces describe nonidentifiability. Least squares projects an observation vector onto the prediction space. Orthogonality produces the normal equations, but a good fit is a mathematical property of a chosen model, not a guarantee of business validity.