next up previous
Next: Non-Linear Regression Up: Linear Regression and Non-Linear Previous: Linear Regression and Non-Linear

Linear regression

Consider a set of data values of the form tex2html_wrap_inline611 . We think of y as a function of x, i.e. tex2html_wrap_inline617 , and seek to estimate the optimal parameters tex2html_wrap_inline619 of the model tex2html_wrap_inline621 . For example, f might be parameterized by a slope m and an intercept b, as in

displaymath593

Then tex2html_wrap_inline619 would be the vector

displaymath594

We anticipate the presence of error, often assumed to be of the form

displaymath595

The upshot is that the error makes the data straddle the line (rather than fit it exactly).

We generally try to find the parameters using the principle of ``least squares'': that is, we try to minimize the ``sum of the squared errors'', or the function

displaymath596

If we take partial derivatives of this expression with respect to the parameters, and set them to zero, we obtain two equations:

displaymath597

They look a lot simpler in vector form, however:

displaymath598

If we define

displaymath599

and write the vector of parameters as tex2html_wrap_inline619 , then we can write the system more succinctly as

displaymath600

With any luck, the matrix product X'X is invertible, so, formally, the parameters are estimated to be

displaymath601

This form readily generalizes, of course, to the case where there are p independent predictor variables, rather than the single variable x. If we include the ``one vector'' tex2html_wrap_inline639 , then we will have an intercept term in the linear model; otherwise, no.



LONG ANDREW E
Mon May 3 09:10:25 EDT 2010