Section 5.8 Regression/Least Squares Approximation

Similar documents
Least squares problems Linear Algebra with Computer Science Application

Identify the graph of a function, and obtain information from or about the graph of a function.

5.6 Logarithmic and Exponential Equations

115.3 Solutions to some odd numbered problems from section 1.3

MA.8.1 Students will apply properties of the real number system to simplify algebraic expressions and solve linear equations.

Mathematics Review. Sid Rudolph

Regression and Nonlinear Axes

1. Let m 1 and n 1 be two natural numbers such that m > n. Which of the following is/are true?

Systems of Algebraic Equations and Systems of Differential Equations

College Algebra and College Algebra with Review Final Review

Algebra I Assessment. Eligible Texas Essential Knowledge and Skills

Internet Mat117 Formulas and Concepts. d(a, B) = (x 2 x 1 ) 2 + (y 2 y 1 ) 2., y 1 + y 2. ( x 1 + x 2 2

Learning Module 1 - Basic Algebra Review (Appendix A)

A VERTICAL LOOK AT KEY CONCEPTS AND PROCEDURES ALGEBRA I

Spiral Review Probability, Enter Your Grade Online Quiz - Probability Pascal's Triangle, Enter Your Grade

Algebra II Vocabulary Alphabetical Listing. Absolute Maximum: The highest point over the entire domain of a function or relation.

Algebra 1 Khan Academy Video Correlations By SpringBoard Activity and Learning Target

ES-2 Lecture: More Least-squares Fitting. Spring 2017

Linear Regression Linear Least Squares

COMMON CORE STATE STANDARDS TO BOOK CORRELATION

CURRICULUM MAP. Course/Subject: Honors Math I Grade: 10 Teacher: Davis. Month: September (19 instructional days)

Logarithms Dr. Laura J. Pyzdrowski

EDEXCEL NATIONAL CERTIFICATE UNIT 4 MATHEMATICS FOR TECHNICIANS OUTCOME 1

ESSENTIALS OF ALGEBRA II

Describing the Relationship between Two Variables

ALGEBRA 2. Background Knowledge/Prior Skills Knows what operation properties hold for operations with matrices

A Library of Functions

Internet Mat117 Formulas and Concepts. d(a, B) = (x 2 x 1 ) 2 + (y 2 y 1 ) 2. ( x 1 + x 2 2., y 1 + y 2. (x h) 2 + (y k) 2 = r 2. m = y 2 y 1 x 2 x 1

Curve Fitting. Objectives

Conceptual Questions for Review

FUNCTIONS AND MODELS

Quantile Textbook Report

College Algebra. Course Text. Course Description. Course Objectives. StraighterLine MAT101: College Algebra

Region 16 Board of Education. Precalculus Curriculum

Algebra I. CORE TOPICS (Key Concepts & Real World Context) UNIT TITLE

NFC ACADEMY COURSE OVERVIEW

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Projections and Least Square Solutions. Recall that given an inner product space V with subspace W and orthogonal basis for

HMH Fuse Algebra correlated to the. Texas Essential Knowledge and Skills for Mathematics High School Algebra 1

x is also called the abscissa y is also called the ordinate "If you can create a t-table, you can graph anything!"

Review of Section 1.1. Mathematical Models. Review of Section 1.1. Review of Section 1.1. Functions. Domain and range. Piecewise functions

The matrix will only be consistent if the last entry of row three is 0, meaning 2b 3 + b 2 b 1 = 0.

Mathematics Online Instructional Materials Correlation to the 2009 Algebra II Standards of Learning and Curriculum Framework

Algebra vocabulary CARD SETS Frame Clip Art by Pixels & Ice Cream

Skill 6 Exponential and Logarithmic Functions

Experimental Uncertainty (Error) and Data Analysis

EDEXCEL NATIONAL CERTIFICATE UNIT 4 MATHEMATICS FOR TECHNICIANS OUTCOME 1

College Algebra To learn more about all our offerings Visit Knewton.com

Section 3.1. Best Affine Approximations. Difference Equations to Differential Equations

Least Squares Regression

5 Systems of Equations

SUMMER REVIEW PACKET. Name:

4.1 Solutions to Exercises

Appendix A. Common Mathematical Operations in Chemistry

evaluate functions, expressed in function notation, given one or more elements in their domains

ECE 204 Numerical Methods for Computer Engineers MIDTERM EXAMINATION /8:00-9:30

Algebra II Learning Targets

Salinity Calibration fit with Matlab

Graphical Analysis and Errors MBL

Linear Equations. Find the domain and the range of the following set. {(4,5), (7,8), (-1,3), (3,3), (2,-3)}

correlated to the Utah 2007 Secondary Math Core Curriculum Algebra 1

Final Exam C Name i D) 2. Solve the equation by factoring. 4) x2 = x + 72 A) {1, 72} B) {-8, 9} C) {-8, -9} D) {8, 9} 9 ± i

SECTION 7: CURVE FITTING. MAE 4020/5020 Numerical Methods with MATLAB

Order of Operations. Real numbers

Linear Regression and Its Applications

Jim Lambers MAT 419/519 Summer Session Lecture 13 Notes

Appendix. Using Your Calculator. Squares, Square Roots, Reciprocals, and Logs. Addition, Subtraction, Multiplication, and Division

Problem 1: (3 points) Recall that the dot product of two vectors in R 3 is

Reference Material /Formulas for Pre-Calculus CP/ H Summer Packet

1.2 Mathematical Models: A Catalog of Essential Functions

Math Review ECON 300: Spring 2014 Benjamin A. Jones MATH/CALCULUS REVIEW

ALGEBRA 2 MIDTERM REVIEW. Simplify and evaluate the expression for the given value of the variable:

Evaluate the exponential function at the specified value of x. 1) y = 4x, x = 3. 2) y = 2x, x = -3. 3) y = 243x, x = ) y = 16x, x = -0.

Section 1.4. Meaning of Slope for Equations, Graphs, and Tables

Graphical Solutions of Linear Systems

Linear Algebra Using MATLAB

Accelerated Advanced Algebra. Chapter 1 Patterns and Recursion Homework List and Objectives

LEAST SQUARES DATA FITTING

Alabama Course of Study Mathematics

MAT 1339-S14 Class 10 & 11

GRADE 8. Know that there are numbers that are not rational, and approximate them by rational numbers.

Radnor Middle School Course Overview. Math Introduction to Algebra 1. Prerequisite: Pre-Algebra, Course 3 Grade: 8

Roundoff Error. Monday, August 29, 11

Huntington Beach City School District Grade 8 Mathematics Accelerated Standards Schedule

MAC Module 8. Exponential and Logarithmic Functions I. Learning Objectives. - Exponential Functions - Logarithmic Functions

Numerical Methods of Approximation

Fundamentals of Linear Algebra. Marcel B. Finan Arkansas Tech University c All Rights Reserved

MAC Module 8 Exponential and Logarithmic Functions I. Rev.S08

Math 1314 Week #14 Notes

I can Statements Grade 8 Mathematics

MS Algebra 1 Scope and Sequence Quarter 1 Overview

Matrices. A matrix is a method of writing a set of numbers using rows and columns. Cells in a matrix can be referenced in the form.

Algebra 2. Chapter 4 Exponential and Logarithmic Functions. Chapter 1 Foundations for Functions. Chapter 3 Polynomial Functions

VCE. VCE Maths Methods 1 and 2 Pocket Study Guide

INTERNET MAT 117. Solution for the Review Problems. (1) Let us consider the circle with equation. x 2 + 2x + y 2 + 3y = 3 4. (x + 1) 2 + (y + 3 2

MATH-1420 Review Concepts (Haugen)

80 Wyner PreCalculus Spring 2017

Chapter 1 Linear Equations and Graphs

HW#1. Unit 4B Logarithmic Functions HW #1. 1) Which of the following is equivalent to y=log7 x? (1) y =x 7 (3) x = 7 y (2) x =y 7 (4) y =x 1/7

Transcription:

Section 5.8 Regression/Least Squares Approximation Key terms Interpolation via linear systems Regression Over determine linear system Closest vector to a column space Linear regression; least squares line Normal system of equations Linerization Semilog and Loglog plots

Regression is a powerful technique for predicting the value of a dependent variable and estimating the values of model parameters. The method has wide application. In interpolation we force the error to be zero at specific isolated locations hence the process can be viewed as a local procedure. In regression the error is minimized in a certain way in a global sense for data involved. In interpolation we constructed linear systems either directly or indirectly through the use of basis functions that had unique solutions hence coefficient matrices were square and nonsingular. In this case the linear system Ax = b is consistent, or equivalently, b is in the column space of A. That is, b is a linear combination of the columns of A.

In regression the model being constructed is over determined meaning the number of coefficients in the model is smaller than the number of data points used. That is, we are dealing with a linear system of equations in which there are more equations than unknowns. Such linear systems arise naturally from experiments or collections of data which consist of a large number of observations that are used to estimate a few unknowns in a mathematical model. Examples include computing the orbit of a satellite or path of a projectile, determining rate constants of various types, and, in general, calculating coefficients in a proposed model of a physical phenomenon or process. Since errors will invariably be included in such observational data, it is expected that such over determined linear systems will be inconsistent. Whether the resulting linear system is inconsistent or not, values of unknown coefficients of the model are required. If the linear system Ax = b is inconsistent, then the use of row operations will fail to yield a result. In such cases an alternative is to seek a vector z so that the product Az is as close to the right side b as possible. Since Az is a linear combination of the columns of A and hence in the column space of A, denoted col(a), we can rephrase the situation as follows: Determine the vector in col(a) that is closest to b. This implies that we must solve a minimization problem; namely, determine the minimum distance from b to the subspace col(a). Note that if the linear system is consistent, then the standard solution x of Ax = b is in col(a) and hence the distance between b and col(a) is zero. Thus the minimization problem includes the solution of consistent linear systems as a special case.

Since regression requires a minimization problem we can expect calculus to be involved, but in some instances a clever matrix algebra approach can be used. Regression/Least Squares Line If a scatter plot of a data set S = {(x 1,y 1 ), (x 2,y 2 ),..., (x n,y n )} looks like it can be well approximated by a straight line y = mx + b then we want the best values of parameters m and b so that the error involved is minimized. The technique to determine the line of best fit is known as the method of least squares since we adopt the criterion that we want to minimize the sum of the squares of the vertical distance from a data point to the line y = mx + b. The vertical distance, often called the deviation, from a point (x i,y i ) to the line y = mx + b is given by the expression (mx i + b - y i ), which is just the difference of the y-coordinates of the data point and the point on the line when x = x i. Computing this difference for each point in S, squaring the quantities, and adding them gives the expression E(m,b) shown next: b g b g b g E(m,b) = mx + b y + mx + b y + + mx + b y 1 1 2 2 2 2 n n 2 This expression is called the sum of the squares of the deviations. The line of best fit is obtained by determining the values of m and b that minimize the sum of the squares of the deviations given in the expression E(m,b). n 2 Using summation notation we have E(m,b) = (mxi + b y i) i= 1

To use calculus to obtain the values that minimize E(m,b) we proceed as follows. Compute the partial derivative of E(m,b) with respect to m and the partial with respect to b, set them equal to zero and solve for m and b. We obtain This gives us two equations in the unknowns m and b which can be simplified and rearranged into the following form:

The matrix C is nonsingular (See the exercises.) so Cz = d has a unique solution. The resulting values of m and b are, respectively, the slope and y-intercept of the line of best fit. The linear system Cz = d is called the normal system of equations for the line of best fit. When we want to compute the line of best fit for a particular data set we can immediately construct the normal system of equations and then find its solution. There is no need to repeat the minimization steps employed to obtain (1). We illustrate the technique in Example 1.

We construct the normal system of equations:

Solving for m and b we find that (to four decimal places) m= -3.5582 and b = 58.6159. Hence the line of best fit is y = -3.5582x + 58.6159. (2) The line of best fit can also be used as a mathematical model to estimate either the temperature at a given altitude or the altitude at which a specific temperature occurs. For instance to estimate the temperature at an altitude of 40,000 ft we set x = 40 in (2) to obtain y = -3.5582(40) + 58.6159 = -83.7121, or approximately -84 F. In a similar fashion, if we want to estimate the altitude at which the temperature is -30 F, we set y = -30 and solve for x. We find that x 30 58.6159 = 3.5582 88.6159 = 3.5582 24.9047 so a temperature of -30 F occurs at approximately 25,000 ft.

Figure 1 shows both the data from Table 1 and the line of best fit. Note that this line comes very close to all the data, which is a strong indication that there is a linear relationship between altitude and temperature. Figure 1.

Matrix Computations to Obtain the Normal Equations The normal system of equations was derived using calculus. Here we show how to develop the normal equations directly from the system of equations derived from the expression y i = mx i + b which have the following matrix equation. The development we present is not an alternate verification that we have obtained the line closest to all the data in the least squares sense, rather it provides an easy matrix formulation of the normal system of equations. We proceed with a set of observations regarding the entries of the matrix C and right side d of the normal system of equations. Each of the entries of C and d can be expressed as a dot product:

Each of the entries of C and d can be expressed as a dot product: Comparing these expressions to the entries of C and d and recalling that the entries of the product of a pair of matrices can be expressed as dot products we see that

From the expressions x1 1 y1 x2 1 y 2 m = b x 1 y n n Az = y we have that the normal system of equations is obtained from the over determined system by multiplying both sides by A T to give A T Ax = A T y. This matrix formulation of the normal system of equations, whose solution leads to the slope and y-intercept of the line of best fit, is useful in computer calculations.

Transformations to Linear/Linearization In many circumstances, a least squares line model is not appropriate. Growth and decay phenomena often obey exponential laws and still other phenomena are modeled by logarithmic laws, and in some cases higher degree polynomials provide good models. A scatter plot of the data can be useful in determining the type of model to construct. Below are some graphs of families of curves that can be considered. (Note that these curves are monotone.)

Let S = {(x i, y i ) : i=1,2,...,n}. To attempt to model the data in set S by one of the function forms y = F(A,B,x) shown above we proceed as in the linear case. Namely minimize the square root of the sum of the squares of the deviations which is given by n b yi F A, B, x i= 1 c gh 2 (In practice to simplify the algebra we just minimize the sum of the squares of the deviations.) When we take the partial derivative of the expression with respect to A and then with respect to B and set each of these equal to zero we are lead to two equations to solve for the A and B. Unfortunately with the function forms given above the system of equations is nonlinear. In order to avoid having to solve a nonlinear system we often perform a transformation on the data set so that the transformed data set can be fit with a straight line. We say we perform a transformation on the equation that linearizes it; that is, converts it into a linear combination of functions to which we can apply an approach which requires that we solve a linear system of equations.

Next let A = log(a) and B = b and we can write the matrix form of the over determined linear system as and multiply both sides of the preceding equation by C T to obtain the 2 by 2 linear system to solve for A and B. Finally we solve for parameters a and b; a = 10 A and b = B and we have the model equation y = ax b. Note: the linearized approach does not necessarily provide the same values for the parameters as solving the nonlinear model.

1.6 Wingspan in meters 1.4 1.2 1 0.8 0.5 1 1.5 2 2.5 3 3.5 Weight in Kilograms Recall that A = ln(a) so a = e A and B = b.

Next let A = log(a) and B = log(b) and we can write the matrix form of the over determined linear system as and multiply both sides of the preceding equation by C T to obtain the 2 by 2 linear system to solve for A and B. Finally we solve for parameters a and b; a = 10 A and b = 10 B and we have the model equation y = ab x. Note: the linearized approach does not necessarily provide the same values for the parameters as solving the nonlinear model. Another function form that is useful is y = a + b log(x).

MATLAB graphics commands: SEMILOGX Semi-log scale plot. semilogx(...) is the same as PLOT(...), except a logarithmic (base 10) scale is used for the X-axis. SEMILOGY Semi-log scale plot. semilogy(...) is the same as PLOT(...), except a logarithmic (base 10) scale is used for the Y-axis. LOGLOG Log-log scale plot. loglog(...) is the same as PLOT(...), except logarithmic scales are used for both the X- and Y- axes. As with most MATLAB command, these should be used in lower case.