ISC 210 Computational Methods Least Squares Fall 20102011

  • Slides: 13
Download presentation
ISC 210 Computational Methods Least Squares Fall 2010/2011 Dr. Jehad Al Dallal

ISC 210 Computational Methods Least Squares Fall 2010/2011 Dr. Jehad Al Dallal

Introduction n Least square method n Minimizing the deviation function D defined as follows

Introduction n Least square method n Minimizing the deviation function D defined as follows

Linear Regression n n Regression: approximation using least squares method G(x)=a 1+a 2 x

Linear Regression n n Regression: approximation using least squares method G(x)=a 1+a 2 x

Example n n Use linear regression to fit the following data set x 0

Example n n Use linear regression to fit the following data set x 0 1 2 3 5 y 0 1. 4 2. 2 3. 5 4. 4 xi=11, fi=11. 5, xifi=38. 3, xi 2=39 a 1=0. 368, a 2=0. 878 G(x)=0. 368+0. 878 x

Linearization n G(x)=a 1 xa 2 where

Linearization n G(x)=a 1 xa 2 where

Example (1) n The following data can be described by the function G(x)=a 1

Example (1) n The following data can be described by the function G(x)=a 1 xa 2, find a 1 and a 2 x y n Solution 1 1 2 4 3 8 4 14

Example (2) n n n Calculate a 1’, a 2 Calculate a 1=e 0.

Example (2) n n n Calculate a 1’, a 2 Calculate a 1=e 0. 0213=1. 0215 G=1. 0215 x 1. 8941

Nonlinear Regression n n G(x)=a 1+a 2 x+a 3 x 2 Solve the following

Nonlinear Regression n n G(x)=a 1+a 2 x+a 3 x 2 Solve the following system

Example (1) n n Derive a second-order approximating polynomial for the following data Solution

Example (1) n n Derive a second-order approximating polynomial for the following data Solution x 0 1 2 3 4 5 6 7 8 y 4 5 10 17 21 16 11 3 1

Example (2) a 1=1. 29, a 2=7. 97, a 3=-1. 03 G=1. 29+7. 97

Example (2) a 1=1. 29, a 2=7. 97, a 3=-1. 03 G=1. 29+7. 97 x-1. 03 x 2

Goodness of functional approximation n Correlation coefficient where n n R 2=1 perfect correlation

Goodness of functional approximation n Correlation coefficient where n n R 2=1 perfect correlation R 2=0 No correlation

Examples n Linear regression example n G(x)=0. 368+0. 878 x xi fi Gi n

Examples n Linear regression example n G(x)=0. 368+0. 878 x xi fi Gi n n D=0. 541 R 2=0. 954 0 0 0. 368 1 1. 4 1. 246 2 2. 124 3 3. 5 3. 002 5 4. 4 4. 758

Examples n Linearization example n n n D=0. 088 R 2=1. 032 Nonlinear regression

Examples n Linearization example n n n D=0. 088 R 2=1. 032 Nonlinear regression example n n D=65. 132 R 2=0. 833