Introduction
Consider a series of

given data points in

-dimensional space,

, where

is a vector, for all

. Define a function

through
where

and

are given functions, for all

. Also, define the function

as the sum of squared residuals:
The method of
least squares fitting refers to finding the parameters

which are the solution to the following unconstrained optimization problem:
After solving this problem, the function

which provides the best fit, in the least-squares sense, is given by:
This general framework allows us to classify the different types of regression, as follows:
- When
the method is known as univariate regression, while if
we have multivariate regression.
- Provided that all the functions
are linear, the method is called linear regression, otherwise it is known as nonlinear regression.
- Also, based on the type of the functions
we may have polynomial regression, regression by orthogonal polynomials, and so on.