Linear Least-Squares Approximation Ellen and Jason.

Slides:



Advertisements
Similar presentations
Linear Least Squares Approximation Jami Durkee. Problem to be Solved Finding Ax=b where there are no solution y=x y=x+2 Interpolation of graphs where.
Advertisements

Finding the equation of a line.
QUADRATIC EQUATIONS.
3.2 Connections to Algebra Solving systems of linear equations AND Equations of lines.
Solving Quadratic Equations Lesson 9-3
MTH 065 Elementary Algebra II
Ch. 5 Polynomials, Polynomial Functions, & Factoring
2.1 – Linear Equations in One Variable
Linear Equations in One Variable Objective: To find solutions of linear equations.
EXAMPLE 3 Write an equation for a function
3.7 Absolute Value Equations and Inequalities I can solve equations and inequalities involving absolute value.
5.5 Solving Quadratic Equations by Factoring
Quadratics       Solve quadratic equations using multiple methods: factoring, graphing, quadratic formula, or square root principle.
1.3 “Solving Linear Equations” Steps: 1.Isolate the variable. 2.To solve when there is a fraction next to a variable, multiply both sides by the reciprocal.
6-1 System of Equations (Graphing): Step 1: both equations MUST be in slope intercept form before you can graph the lines Equation #1: y = m(x) + b Equation.
Ch 9: Quadratic Equations B) Square Roots Objective: To solve quadratic equations using square roots.
Section 4.2 Least Squares Regression. Finding Linear Equation that Relates x and y values together Based on Two Points (Algebra) 1.Pick two data points.
1) Which set of coordinates describe a function A)(2, -4), (-2,-7), (0,2), (-3,-8) B)(6,2), (3,5), (3,10), (-1, 7) C)(6,-4) (-3,-3), (-2, -2), (6, -8)
Section 5 Absolute Value Equations and Inequalities
§ 2.8 Solving Linear Inequalities. Martin-Gay, Beginning and Intermediate Algebra, 4ed 22 Linear Inequalities in One Variable A linear inequality in one.
Quadratics Solving equations Using “Completing the Square”
Solving Quadratic Equations by Factoring Terminology Zero Factor Theorem Methods for Solving.
Chapter 1.7 Inequalities. An inequality says that one expression is greater than, or greater than or equal to, or less than, or less than or equal to,
Math 021.  An equation is defined as two algebraic expressions separated by an = sign.  The solution to an equation is a number that when substituted.
Chapter 10 Review for Test. Section 10.1:Graph y = ax² + c Quadratic Equation (function) _____________ Parabola is the name of the graph for a quadratic.
Goal: Solve linear equations.. Definitions: Equation: statement in which two expressions are equal. Linear Equation (in one variable): equation that.
CDAE Class 3 Sept. 5 Last class: 1.Introduction Class exercise 1 Today: Results of class exercise 1 1. Introduction Class exercise 2 Next class:
Chapter 1 - Fundamentals Inequalities. Rules for Inequalities Inequalities.
1.5 – Day 1 Equations.
Pre-Calculus Section 1.7 Inequalities Objectives: To solve linear inequalities. To solve absolute value inequalities.
Section 4.3 Solving Absolute Value Equations and Inequalities
Copyright © 2014, 2010, 2007 Pearson Education, Inc. 1 1 Chapter 9 Quadratic Equations and Functions.
Copyright © Cengage Learning. All rights reserved. 1 STRAIGHT LINES AND LINEAR FUNCTIONS.
Lesson 7. Literal Equations  I can identify literal equations.  I can rewrite and use literal equations Objectives.
CHAPTER 3 GRAPHING LINEAR FUNCTIONS  What you will learn:  Determine whether relations are functions  Find the domain and range of a functions  Identify.
Solving One-Step Equations © 2007 by S - Squared, Inc. All Rights Reserved.
Complex Numbers Definitions Graphing 33 Absolute Values.
Chapter 6 Section 5. Objectives 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Solving Quadratic Equations by Factoring Solve quadratic equations.
Copyright © 2011 Pearson Education, Inc. Systems of Linear Equations in Two Variables Section 5.1 Systems of Equations and Inequalities.
Slide Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Bell Ringer: Simplify each expression
Copyright © 2012 Pearson Education, Inc. Publishing as Addison Wesley R.5 The Basics of Equation Solving  Solve linear equations.  Solve quadratic equations.
SOLVING LINEAR SYSTEMS by GRAPHING ADV133 Put in slope-intercept form: y = mx + b. y = 4x – 1 y = –x + 4 The solution to a system of linear equations is.
Linear Regression Line of Best Fit. Gradient = Intercept =
 A.4f Apply these skills to solve practical problems.  A.4b Justify steps used in solving equations.  Use a graphing calculator to check your solutions.
Method 3: Least squares regression. Another method for finding the equation of a straight line which is fitted to data is known as the method of least-squares.
EXAMPLE 4 Solve linear systems with many or no solutions Solve the linear system. a.x – 2y = 4 3x – 6y = 8 b.4x – 10y = 8 – 14x + 35y = – 28 SOLUTION a.
WARM UP 1. Simplify 2. Multiply 3. Divide. QUADRATIC EQUATIONS INTRODUCTION.
Warm Up Solve by graphing (in your calculator) 1) 2)
Solving equations with variable on both sides Part 1.
Solving Quadratic Equations by the Quadratic Formula.
Using the Quadratic Formula to Find Solutions
Students will be able to:
Linear Equations in One Variable
Chapter 2 Equations and Inequalities in One Variable
To solve absolute value equations and inequalities in one variable
Solve a system of linear equation in two variables
Use back - substitution to solve the triangular system. {image}
The Quadratic Formula.
6-3 Solving Systems Using Elimination
Quadratic Equations and Functions
1.4 Solving Equations Using a Graphing Utility
Solving Linear Inequalities
Discrete Least Squares Approximation
Solving Square Root Equations
Mathematical Sciences
Chapter 6 Section 5.
Absolute Value Inequalities
3 Chapter Chapter 2 Graphing.
Maths Unit 25 – Solving Equations
Presentation transcript:

Linear Least-Squares Approximation Ellen and Jason

Problem the Algorithm Solves Finds a function that most clearly passes through a set of points Algorithm is used for – Summarizing data – Predicting data

Standard variable names & expressions p =  X k q =  Y k r =  X k Y k s =  X k ) 2 d = (m + 1) s - (p) 2 a = [(m + 1) r - pq] / d b =[sq – pr] / d y = ax + b

Standard Terms & Definitions l 1 Approximation:  ax k + b – y k  l 2 Approximation:  a, b  ax k + b – y k  2

Principle behind algorithm/How it was derived  (y i – ax i - b) 2 This equation gives us the error.

Principle behind algorithm/How it was derived Now we take the derivative with respect to m, and with respect to b. df/dm =  2(y i - mx i - b)(-x i ) =  -2x i y i + 2mx i 2 + 2bx i df/db =  2(Y i - mx i - b)(-1) =  -2y i + 2mx i + 2b

Principle behind algorithm/How it was derived Now we want to set the equations to 0 because we are trying to find the minimum error. On the graph you can see that the minimum is at a point where the derivative would equal 0.  -2y i + 2mx i + 2b =  -2y i ) + m  (2x i ) + b  (2)  -2x i y i + 2mx i 2 + 2bx i  (-2x i y i ) + m  (2x i 2 ) + b  (2x i )

Principle behind algorithm/How it was derived  (-2x i y i ) + m  (2x i 2 ) + b  (2x i ) = 0 m  (2x i 2 ) + b  (2x i ) =  (2x i y i ) m  (x i 2 ) + b  (x i ) =  (x i y i )  -2y i ) + m  (2x i ) + b  (2) = 0 m  (2x i ) + b  (2) =  (2y i ) m  (x i ) + b =  (y i )

Principle behind algorithm/How it was derived Am + Bb = E Cm + Db = F To get rid of variables A, C and m we multiply the first equation by C and the second equation by -A C(Am +Bb = E) -A(Cm + Db = F) => ACm + BCb = EC -ACm - ADb = -AF (BC – AD)b = EC – AF b = (EC-AF)/(BC-AD)

Principle behind algorithm/How it was derived Am + Bb = E Cm + Db = F Now, in order to get rid of b, we multiply the first equation by D and the second equation by (-B) D(Am +Bb = E) -B(Cm + Db = F) => ADm + BDb = ED -BCm - BDb = -BF (AD - BC)m = ED - BF m = (AD - BC)/(ED - BF)

Example Find the linear least-squares solution for the table of values p = = 17 q = = 25 r = (1*2) + (3*6) + (4*9) + (9*8) = 128 s = (1 2 ) + (3 2 ) + (4 2 ) + (9 2 ) = 107 d =(3+1)*107 - (17 2 ) = 139 a = [(3+1)*128- (17*25)] / 139 = 87/139 b = [(107*25) - (17*128)] / 139 = 499/139 Y = ax+b Y = (87/139)x + (499/139)

Example: Graph

Example: Error Point y - (ax +b) Point 1: [2 - (0.6259* )] 2 = Point 2: [6 - (0.6259* )] 2 = Point 3: [9 - (0.6259* )] 2 = Point 4: [8 - (0.6259* )] 2 = Error:

Advantages Least Squares RegressionLeast Absolute Deviation Regressions Not Very RobustRobust Stable SolutionUnstable Solution Always One SolutionPossibly Multiple Solutions

Disadvantages Limitations in shapes – May not be effective for data that is nonlinear. For example, a linear function would not represent the sets of points in this graph very well.