Least-squares adjustment

Least-squares adjustment is a model for the solution of an overdetermined system of equations based on the principle of least squares of observation residuals. It is used extensively in the disciplines of surveying, geodesy, and photogrammetry—the field of geomatics, collectively.
Formulation.
There are three forms of least squares adjustment: "parametric", "conditional", and "combined":
Clearly, parametric and conditional adjustments correspond to the more general combined case when "f(X,Y)=h(X)-Y" and "f(X,Y)=g(Y)", respectively. Yet the special cases warrant simpler solutions, as detailed below. Often in the literature, "Y" may be denoted "L".
Solution.
The equalities above only hold for the estimated parameters formula_1 and observations formula_2, thus formula_3. In contrast, measured observations formula_4 and approximate parameters formula_5 produce a nonzero "misclosure":
One can proceed to Taylor series expansion of the equations, which results in the Jacobians or design matrices: the first one,
and the second one,
The linearized model then reads:
where formula_10 are estimated "parameter corrections" to the "a priori" values, and formula_11 are post-fit "observation residuals".
In the parametric adjustment, the second design matrix is an identity, "B=-I", and the misclosure vector can be interpreted as the pre-fit residuals, formula_12, so the system simplifies to:
which is in the form of ordinary least squares. 
In the conditional adjustment, the first design matrix is null, "A=0".
For the more general cases, Lagrange multipliers are introduced to relate the two Jacobian matrices and transform the constrained least squares problem into an unconstrained one (albeit a larger one). In any case, their manipulation leads to the formula_1 and formula_2 vectors as well as the respective parameters and observations "a posteriori" covariance matrices.
Computation.
Given the matrices and vectors above, their solution is found via standard least-squares methods; e.g., forming the normal matrix and applying Cholesky decomposition, applying the QR factorization directly to the Jacobian matrix, iterative methods for very large systems, etc.
Extensions.
If rank deficiency is encountered, it can often be rectified by the inclusion of additional equations imposing constraints on the parameters and/or observations, leading to constrained least squares.