Sum of squares
In mathematics, statistics and elsewhere, sums of squares occur in a number of contexts: == Statistics == For partitioning of variance, see Partition of sums of squares For the "sum of squared deviations", see Least squares For the "sum of squared differences", see Mean squared error For the "sum of squared error", see Residual sum of squares For the "sum of squares due to lack of fit", see Lack-of-fit sum of squares For sums of squares relating to model predictions, see Explained sum of squares For sums of squares relating to observations, see Total sum of squares For sums of squared deviations, see Squared deviations from the mean For modelling involving sums of squares, see Analysis of variance For modelling involving the multivariate generalisation of sums of squares, see Multivariate analysis of variance == Number theory == Fermat's theorem on sums of two squares says which primes are sums of two squares. The sum of two squares theorem generalizes Fermat's theorem to specify which composite numbers are the sums of two squares.