Method of Least Squares

Explained:

method of least squares

ordinary least squares

overfit

 
   

The method of least squares is an alternative to interpolation for fitting a function to a set of points. Unlike interpolation, it does not require the fitted function to intersect each point. The method of least squares is probably best known for its use in statistical regression, but it is used in many contexts unrelated to statistics. The method encompasses many techniques. We present a fairly general approach called ordinary least squares.

Example
Suppose researchers gather 10 data points related to some phenomenon. We interpolate a ninth-order polynomial based upon the data. See Exhibits 1 and 2:

Example: Hypothetical Data
Exhibit 1

k

x[k]

y[k]

1

1.1

2.14

2

1.4

2.60

3

2.5

1.15

4

2.7

1.19

5

3.2

1.88

6

3.6

1.55

7

4.1

2.65

8

4.3

3.80

9

4.5

4.46

10

4.9

6.35

Hypothetical data to be used in comparing interpolation with ordinary least squares.

 

Example: Interpolation
Exhibit 2

Interpolated ninth-order polynomial.

Because the polynomial is forced to intercept every point, it weaves up and down. In some applications, data may reflect random errors or other sources of “noise.” Forcing a curve to pass through each point causes its shape to reflect such noise as much as any underlying process that generated the data. We say the interpolated function is overfit to the data. As an alternative, we may fit a curve to data without requiring that it intercept each point. A quadratic polynomial fit in this manner to the data of Exhibit 1 is illustrated in Exhibit 3.

Example: Least Squares
Exhibit 3

A quadratic polynomial fit to the data of Exhibit 1 using the method of ordinary least squares.

     
   

The polynomial of Exhibit 3 was constructed with the method of ordinary least squares. The form of the polynomial was specified as follows

[1]

with the constants determined in such a manner as to minimize the sum of squares

[2]

Ordinary Least Squares
Consider l points where , and . We wish to fit a function of form

[3]

to the data in such a manner as to minimize the sum of squares

[4]

 

Ads by Contingency Analysis

As with ordinary interpolation, functions : can take any form. Unlike interpolation, we require that the number m of functions be less than the number l of points.

Let’s express our problem with matrices. Define

[5]

This is unknown. It is what we want to solve for. Define f as the l m matrix comprising values of each function evaluated at each point :

[6]

Define the vector

[7]

Both the matrix f and vector y are constants. They are known. We express sum-of-squares formula [4] as

[8]

[9]

This is a quadratic polynomial in . It can be shown that, if f has linearly independent columns, it has a unique minimum, which occurs at

[10]

Example (Continued)
Continuing with our example of fitting a quadratic polynomial to the data of Exhibit 1, we seek a polynomial

[11]

 
   

where

f1(x) = 1,

f2(x) = x,

f3(x) = x2.

Let

[12]

We have

[13]

and

[14]

 

Ads by Contingency Analysis

 

 

Applying [10], we obtain

[15]

and our quadratic polynomial is

[16]

which was graphed in Exhibit 3.

Exercises

Use ordinary least squares to fit a linear polynomial

[e1]

to the five points indicated in Exhibit E1.

k
1 1 13
2 2 10
3 3 11
4 4 8
5 5 6

Exhibit E1 Point set for Exercise.

[solution]

Use ordinary least squares to fit a linear polynomial

[e2]

to the five points indicated in Exhibit E2.

k
1 (1, 4) 0.55
2 (2, 3) 2.17
3 (2, 5) 4.31
4 (4, 2) 3.32
5 (6, 3) 6.51

Exhibit E2 Point set for Exercise.

[solution]

Prove that, if the number m of functions equals the number l of points , then the least squares solution [10] reduces to the interpolation solution [Interpolation 15]. In this regard, ordinary least squares is a generalization of ordinary interpolation. [solution]

Sponsored Links

Ads by Contingency Analysis

 

Related Internal Links

cubic spline interpolation Any of several methods of interpolating with cubic splines.

interpolation Any procedure for fitting a function to a set of points in such a manner that the function intercepts each of the points.

remapping In value-at-risk, the approximation of one risk vector with another.

linear and quadratic polynomials Two basic forms of polynomials.

Taylor series expansion In calculus, a power series obtained as a limit of Taylor polynomials that may approximate or equal the function from which it is constructed.

Sponsored Links

Ads by Contingency Analysis

 

Disclaimer

website: http://www.contingencyanalysis.com
glossary direct link: http://www.riskglossary.com
copyright © Contingency Analysis, 2006