OpenStax CNX

You are here: Home » Content » Linear Regression

About: Linear Regression

Module by: Paul E Pfeiffer. E-mail the author

View the content: Linear Regression


Name: Linear Regression
ID: m23468
Language: English (en)
Summary: Consider a pair {X,Y} with a joint distribution. A value X(ω) is observed. It is desired to estimate the corresponding value Y(ω). The best that can be hoped for is some estimate based on an average of the errors, or on the average of some function of the errors. The most common measure of error is the mean (expectation) of the square of the error. This has two important properties: it treats positive and negative errors alike, and it weights large errors more heavily than smaller ones. In general, we seek a rule (function) r such that the estimate is r(X(ω)). That is, we seek a function r such that the expectation of the square of Y - r(X) is a minimum. The problem of determining such a function is known as the regression problem. LINEAR REGRESSION: we seek the best straight line function (the regression line of Y on X) of the form u = r(t) + b, such that the mean square of Y - r(X) is a minimum. Matlab approximation procedures are compared with analytic results. More general linear regression is considered
Subject: Mathematics and Statistics
Keywords: Correlation coefficient, Estimates, Mean square error, Regression line
License: Creative Commons Attribution License CC-BY 3.0

Authors: Paul E Pfeiffer (
Copyright Holders: Paul E Pfeiffer (
Maintainers: Paul E Pfeiffer (, Daniel Williamson (, C. Sidney Burrus (

Latest version: 1.6 (history)
First publication date: Apr 17, 2009 12:32 pm -0500
Last revision to module: Sep 18, 2009 1:15 pm -0500


PDF: m23468_1.6.pdf PDF file, for viewing content offline and printing. Learn more.
EPUB: m23468_1.6.epub Electronic publication file, for viewing in handheld devices. Learn more.
XML: m23468_1.6.cnxml XML that defines the structure and contents of the module, minus any included media files. Can be reimported in the editing interface. Learn more.
Source Export ZIP: ZIP containing the module XML plus any included media files. Can be reimported in the editing interface. Learn more.
Offline ZIP: An offline HTML copy of the content. Also includes XML, included media files, and other support files. Learn more.

Version History

Version: 1.6 Sep 18, 2009 1:15 pm -0500 by Daniel Williamson
added google analytics tracking code

Version: 1.5 Jul 27, 2009 12:06 pm -0500 by Daniel Williamson
disjoint union fix

Version: 1.4 Jun 19, 2009 11:12 am -0500 by Daniel Williamson
m-file fixes, supplemental links, metadata updated

Version: 1.3 Jun 9, 2009 5:16 pm -0500 by Daniel Williamson
updated links, images and accessibility

Version: 1.2 May 26, 2009 4:35 pm -0500 by Daniel Williamson
fixed module names, and updated content structure

Version: 1.1 May 19, 2009 10:26 am -0500 by Paul E Pfeiffer

How to Reuse and Attribute This Content

If you derive a copy of this content using a OpenStax_CNX account and publish your version, proper attribution of the original work will be automatically done for you.

If you reuse this work elsewhere, in order to comply with the attribution requirements of the license (CC-BY 3.0), you must include

  • the authors' names: Paul Pfeiffer
  • the title of the work: Linear Regression
  • the OpenStax_CNX URL where the work can be found:

See the citation section below for examples you can copy.

How to Cite and Attribute This Content

The following citation styles comply with the attribution requirements for the license (CC-BY 3.0) of this work:

American Chemical Society (ACS) Style Guide:

Pfeiffer, P. Linear Regression, OpenStax_CNX Web site., Sep 18, 2009.

American Medical Assocation (AMA) Manual of Style:

Pfeiffer P. Linear Regression [OpenStax_CNX Web site]. September 18, 2009. Available at:

American Psychological Assocation (APA) Publication Manual:

Pfeiffer, P. (2009, September 18). Linear Regression. Retrieved from the OpenStax_CNX Web site:

Chicago Manual of Style (Bibliography):

Pfeiffer, Paul. "Linear Regression." OpenStax_CNX. September 18, 2009.

Chicago Manual of Style (Note):

Paul Pfeiffer, "Linear Regression," OpenStax_CNX, September 18, 2009,

Chicago Manual of Style (Reference, in Author-Date style):

Pfeiffer, P. 2009. Linear Regression. OpenStax_CNX, September 18, 2009.

Modern Languages Association (MLA) Style Manual:

Pfeiffer, Paul. Linear Regression. OpenStax_CNX. 18 Sep. 2009 <>.