Chapter 12: Problem 30
Least Squares Given \(n\) points \(\left(x_{1}, y_{1}\right),\left(x_{2}, y_{2}\right), \ldots\), \(\left(x_{n}, y_{n}\right)\) in the \(x y\)-plane, we wish to find the line \(y=m x+b\) such that the sum of the squares of the vertical distances from the points to the line is a minimum; that is, we wish to minimize $$ f(m, b)=\sum_{i=1}^{n}\left(y_{i}-m x_{i}-b\right)^{2} $$
Short Answer
Step by step solution
Define the Objective Function
Use Calculus to Minimize the Function
Solve the System of Equations
Use Normal Equations to Find Values of m and b
Calculate m and b
Verify the Solution
Unlock Step-by-Step Solutions & Ace Your Exams!
-
Full Textbook Solutions
Get detailed explanations and key concepts
-
Unlimited Al creation
Al flashcards, explanations, exams and more...
-
Ads-free access
To over 500 millions flashcards
-
Money-back guarantee
We refund you if you fail your exam.
Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!
Key Concepts
These are the key concepts you need to understand to accurately answer the question.
Objective Function
- \(m\) represents the slope of the line,
- \(b\) is the y-intercept,
- \((x_i, y_i)\) are the given data points,
- The expression \((y_i - mx_i - b)^2 \) represents the square of the distance from each point to the line.
Partial Derivatives
- The partial derivative with respect to \(m\) is \( \frac{\partial f}{\partial m} = -2 \sum (y_i - mx_i - b)x_i = 0 \).
- The partial derivative with respect to \(b\) is \( \frac{\partial f}{\partial b} = -2 \sum (y_i - mx_i - b) = 0 \).
System of Linear Equations
- \( \sum x_i y_i = m \sum x_i^2 + b \sum x_i \)
- \( \sum y_i = m \sum x_i + nb \)
The equations can be solved using algebraic methods such as substitution. Alternatively, they can be resolved using a more streamlined mathematical approach known as the matrix method. These solutions give us the critical values for the least squares fitting line.
Matrix Method
- The first matrix is called the coefficient matrix.
- The second is the vector of unknowns \(m\) and \(b\).
- The third is the result vector from our equations.