Data Processing Techniques

Similar documents
Chapter 5. Curve fitting

PGE 310: Formulation and Solution in Geosystems Engineering. Dr. Balhoff. Interpolation

Simple Linear Regression

ESS Line Fitting

Given a table of data poins of an unknown or complicated function f : we want to find a (simpler) function p s.t. px (

Introduction to Numerical Differentiation and Interpolation March 10, !=1 1!=1 2!=2 3!=6 4!=24 5!= 120

Functions of Random Variables

Linear Regression. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Linear Regression. Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model

Line Fitting and Regression

Objectives of Multiple Regression

Analysis of Lagrange Interpolation Formula

STA 108 Applied Linear Models: Regression Analysis Spring Solution for Homework #1

L5 Polynomial / Spline Curves

Chapter 8. Inferences about More Than Two Population Central Values

12.2 Estimating Model parameters Assumptions: ox and y are related according to the simple linear regression model

Multiple Choice Test. Chapter Adequacy of Models for Regression

Example: Multiple linear regression. Least squares regression. Repetition: Simple linear regression. Tron Anders Moger

Lecture 5: Interpolation. Polynomial interpolation Rational approximation

Simple Linear Regression

Multivariate Transformation of Variables and Maximum Likelihood Estimation

best estimate (mean) for X uncertainty or error in the measurement (systematic, random or statistical) best

Chapter 14 Logistic Regression Models

Statistics MINITAB - Lab 5

ENGI 3423 Simple Linear Regression Page 12-01

The equation is sometimes presented in form Y = a + b x. This is reasonable, but it s not the notation we use.

Lecture 12 APPROXIMATION OF FIRST ORDER DERIVATIVES

Correlation and Simple Linear Regression

Econometric Methods. Review of Estimation

Linear Regression with One Regressor

Evaluation of uncertainty in measurements

Chapter Two. An Introduction to Regression ( )

1 0, x? x x. 1 Root finding. 1.1 Introduction. Solve[x^2-1 0,x] {{x -1},{x 1}} Plot[x^2-1,{x,-2,2}] 3

Multiple Linear Regression Analysis

Radial Basis Function Networks

Multiple Regression. More than 2 variables! Grade on Final. Multiple Regression 11/21/2012. Exam 2 Grades. Exam 2 Re-grades

Lecture Notes Types of economic variables

Johns Hopkins University Department of Biostatistics Math Review for Introductory Courses

Module 7. Lecture 7: Statistical parameter estimation

Johns Hopkins University Department of Biostatistics Math Review for Introductory Courses

UNIT 2 SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

Probability and. Lecture 13: and Correlation

Chapter 13 Student Lecture Notes 13-1

ECON 482 / WH Hong The Simple Regression Model 1. Definition of the Simple Regression Model

Class 13,14 June 17, 19, 2015

CS5620 Intro to Computer Graphics

The Randomized Block Design

Module 7: Probability and Statistics

STA 105-M BASIC STATISTICS (This is a multiple choice paper.)

: At least two means differ SST

ENGI 4421 Propagation of Error Page 8-01

Lecture 8: Linear Regression

CS475 Parallel Programming

IFYMB002 Mathematics Business Appendix C Formula Booklet

Midterm Exam 1, section 1 (Solution) Thursday, February hour, 15 minutes

Some Applications of the Resampling Methods in Computational Physics

THE ROYAL STATISTICAL SOCIETY HIGHER CERTIFICATE

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions.

QR Factorization and Singular Value Decomposition COS 323

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

( ) = ( ) ( ) Chapter 13 Asymptotic Theory and Stochastic Regressors. Stochastic regressors model

Maximum Likelihood Estimation

STA302/1001-Fall 2008 Midterm Test October 21, 2008

Lecture Notes 2. The ability to manipulate matrices is critical in economics.

Wu-Hausman Test: But if X and ε are independent, βˆ. ECON 324 Page 1

LINEAR REGRESSION ANALYSIS

Chapter 8: Statistical Analysis of Simulated Data

Lecture Notes Forecasting the process of estimating or predicting unknown situations

Statistics. Correlational. Dr. Ayman Eldeib. Simple Linear Regression and Correlation. SBE 304: Linear Regression & Correlation 1/3/2018

MEASURES OF DISPERSION

Mathematics HL and Further mathematics HL Formula booklet

Applied Fitting Theory VII. Building Virtual Particles

Simple Linear Regression and Correlation. Applied Statistics and Probability for Engineers. Chapter 11 Simple Linear Regression and Correlation

Basic Concepts in Numerical Analysis November 6, 2017

Taylor s Series and Interpolation. Interpolation & Curve-fitting. CIS Interpolation. Basic Scenario. Taylor Series interpolates at a specific

CLASS NOTES. for. PBAF 528: Quantitative Methods II SPRING Instructor: Jean Swanson. Daniel J. Evans School of Public Affairs

4 Round-Off and Truncation Errors

Transforming Numerical Methods Education for the STEM Undergraduate Torque (N-m)

MMJ 1113 FINITE ELEMENT METHOD Introduction to PART I

Analyzing Two-Dimensional Data. Analyzing Two-Dimensional Data


CH E 374 Computational Methods in Engineering Fall 2007

Numerical Interpolation with Polynomials Approximation and Curve Fitting, Focus the MATLAB

Chapter Business Statistics: A First Course Fifth Edition. Learning Objectives. Correlation vs. Regression. In this chapter, you learn:

Chapter 13, Part A Analysis of Variance and Experimental Design. Introduction to Analysis of Variance. Introduction to Analysis of Variance

b. There appears to be a positive relationship between X and Y; that is, as X increases, so does Y.

Special Instructions / Useful Data

Spreadsheet Problem Solving

CS 2750 Machine Learning. Lecture 8. Linear regression. CS 2750 Machine Learning. Linear regression. is a linear combination of input components x

UNIVERSITY OF OSLO DEPARTMENT OF ECONOMICS

Supervised learning: Linear regression Logistic regression

Midterm Exam 1, section 2 (Solution) Thursday, February hour, 15 minutes

Handout #8. X\Y f(x) 0 1/16 1/ / /16 3/ / /16 3/16 0 3/ /16 1/16 1/8 g(y) 1/16 1/4 3/8 1/4 1/16 1

residual. (Note that usually in descriptions of regression analysis, upper-case

CHAPTER VI Statistical Analysis of Experimental Data

Lecture 1 Review of Fundamental Statistical Concepts

Chapter 5 Properties of a Random Sample

Bayesian Inferences for Two Parameter Weibull Distribution Kipkoech W. Cheruiyot 1, Abel Ouko 2, Emily Kirimi 3

Generative classification models

Transcription:

Uverstas Gadjah Mada Departmet o Cvl ad Evrometal Egeerg Master o Egeerg Natural Dsaster Maagemet Data Processg Techques Curve Fttg: Regresso ad Iterpolato 3Oct7

Curve Fttg Reerece Chapra, S.C., Caale R.P., 99, Numercal Methods or Egeers, d Ed., McGrawHll Book Co., New York. Chapter ad, pp. 39398. 3Oct7

Curve Fttg A le or curve that represets a umber o data pots There are two methods to d such le or curve Regresso Iterpolato Egeerg applcatos Tred aalyss Hypothess testg 3Oct7 3

Regresso vs Iterpolato Regresso The data show sgcat errors or ose To d a sgle curve that represet geeral tred o the data Regresso le (curve) does ot eed to pass every data pot Iterpolato The data are accurate To d a curve or curves that ecompass(es) every data pot To estmate values betwee data pots 3Oct7 4

Regresso ad Iterpolato Etrapolato Smlar to terpolato but appled to outsde rage o data pots Not recommeded 3Oct7 5

Curve Fttg to Measured Data Tred aalyss Use o data tred (measuremets, epermets) to estmate values I the data are accurate, use terpolato techque I the data show ose, use regresso techque Hypothess testg Comparso betwee theoretcal values wth computed oes 3Oct7 6

represet data dstrbuto Recall: Statstcal Parameters Arthmetc mea Stadard devato Varace Coecet o varato! y y s y!! s S t y S t! S y t ( y ) c.v. s y! y % 3Oct7 7

Probablty Dstrbuto 3Oct7 req X Normal Dstrbuto oe o data dstrbutos that s requetly ecoutered egeerg 8

3Oct7 REGRESSION Smple Lear Regresso 9

Regresso: Leastsquare Method To d a sgle curve or ucto (appromate) that represets the geeral tred o the data The data show sgcat error The curve does ot eed to pass every data pot Methods Lear regresso (smple lear regresso) Learzed epressos Polyomal regresso Multple lear regresso Nolear regresso 3Oct7

Regresso: Leastsquare Method How Spreadsheet (MS Ecel) Computer program MatLab Freeware Octave Sclab Freemat 3Oct7

Smple Lear Regresso To d a straght le that represets the geeral tred o data pots: (,y ), (,y ),, (,y ) y reg a + a a : tercept : slope a MS Ecel INTERCEPT(y,) SLOPE(y,) 3Oct7

Smple Lear Regresso Error or resdual Dscrepaces betwee actual value o y (y data) ad appromate value o y (y reg ) accordg to lear epresso a + a! e y ( a +a ) Mmze the sum o squared resdues m! S # "! r $ m! " e! ( ) # $ m y a a "' # $( 3Oct7 3

Smple Lear Regresso How to d a ad a? Deretate the equato o S r twce; rstly w.r.t a ad lastly w.r.t a Set each o the two equatos to zero Solve the equatos or a ad a S r ( y a a a ) S r ( y a a a )! a y a! y a ( ) y 3Oct7 4

Eample # y ( ).5.5 3 3 4 4 4 5 3.5 5 6 6 6 7 5.5 y () 7 6 5 4 3 3 4 5 6 7 3Oct7 X 5

Eample # y y y reg (y y reg ) (y y mea ) 3Oct7.5.5.974.68686 8.57653.5 5 4.75.565.8645 3. 6 9.58986.34758.486 3 4 4. 6 6 3.4857.3653.3653 4 5 3.5 7.5 5 4.67857.58965.5 5 6 6. 36 36 5.743.79794 6.645 6 7 5.5 38.5 49 5.94649.9998 4.986 8 4. 9.5 4.997.749 6

Eample # a y y 4 7 3.4 8 7 4 y ( ) a! 3.4.83986 4 ( ) 8( 4).83986 7( 4) ( 8) 7 9.5 ( ).749 3Oct7 7

Eample # Y 7 6 5 4 3 3 4 5 6 7 8 X data regresso 3Oct7 8

Error Error Stadard error magtude s y! S r Notce ts smlarty wth stadard devato s y!! S y r ( a a ) S t! S y t ( y ) 3Oct7 9

Error Drece betwee the two errors sges a mprovemet o the predcto or a reducto o error r S t S r S t r S r S t y ( )( y ) ( ) y y ( ) coecet o determato correlato coecet 3Oct7

Error ( ) ( ) S r y a a.997 S! t y y.749! r S r S t.9997.749.86838 r.93836 3Oct7

Eample # y ( ) 5.5 6 3 3.5 3 4 4 4 5 5 6.5 6 7.5 y () 7 6 5 4 3 3 4 5 6 7 3Oct7 X

3Oct7 REGRESSION Regresso o Learzed Epresso 3

Lear Regresso Learzed olear equatos Logarthmc eq. à lear eq. Epoetal eq. à lear eq. th order polyomal eq. ( > ) à lear eq. etc. 3Oct7 4

Lear Regresso 3Oct7 y! y aeb l y l a! ly la+b b 5

Lear Regresso 3Oct7 y! y ab log y! loga! logy loga+blog b log 6

Lear Regresso 3Oct7 y! y a b+ /y! y b+ a a + b a! b a! a / 7

3Oct7 REGRESSION Polyomal Regresso 8

Polyomal Regresso Some egeerg data, although ehbtg a marked patter, s poorly represeted by a straght le Method : Coordate trasormato (learzed olear eq.) Method : Polyomal regresso The mthdegree polyomal! y a +a +a +...+a m m The sum o the squares o the resduals S r e y a a +a m +...+a m! ( ) 3Oct7 9

The leastsquare method eteded to t the data to a mthdegree polyomal These equatos ca be set equal to zero ad rearraged to develop a set o ormal equatos S r a S r a! m ( y a a +a m +...+a m ) S r a y a a +a m +...+a m S r a... ( ) ( y a a +a m +...+a m ) m ( y a a +a m +...+a m ) 3Oct7 3

m a +a +a +...+a m y! a 3 m+ +a +a +...+a m y 3 4 m+ a +a +a +...+a m y... m m+ a +a m+ m +a +...+a m m y There are m+ lear equatos havg m+ ukows,.e. a, a, a,, a m These lear equatos ca be smultaeously solved by usg methods such as Gauss elmato GaussJorda Jacob terato Matr verso 3Oct7 3

Eample Ft a secodorder polyomal to the data the table o the rght! y a +a +a Aswer y.47857+.3599+.867 r S r S t 3.74657 53.39.9985! r.9995 y. 7.7 3.6 3 7. 4 4.9 5 6. 3Oct7 3

3Oct7 REGRESSION Multple Lear Regresso 33

Multple Lear Regresso Suppose the depedet varabel y s a lear ucto o two depedet varables ad! y a +a +a The best values o the coecets are determed by settg up the sum o the squares o the resduals S r! ( y a a a ) 3Oct7 34

Multple Lear Regresso Deretatg ths equato w.r.t each o the ukow coecets S r a ( y a a a ) S r a y a a a ( ) S r a y a a a! ( ) Equatg the deretals to zero ad epressg the resulted equato as a set o smultaeous lear eqs yeld a +a +a y! a +a +a y a +a +a y 3Oct7 35

Multple Lear Regresso Wrtte matr orm 3Oct7 " $ $ $ $ $ $ $ $! # % ' '( ' ' * ) '* ' + * ' ' & a a a ( *, * * * ) * *.* * * + * y y y, * * * * * *.* 36

Eample Fd the best lear equato that ts to the data the table o the rght Aswer y 5+ 4 3! R y 5.5 9 3 4 6 3 7 7 3Oct7 37

Multple Lear Regresso Multple lear regresso ca be useul the dervato o power equatos o the geeral orm! y a a a... m a m Such equatos are etremely useul whe ttg epermetal data I order to use the multple lear regresso, the equato s trasormed by takg ts logarthm to yeld! logy loga +a log +a log +...+a m log m 3Oct7 38

3Oct7 REGRESSION Geeral Lear Least Squares 39

Geeral Lear Least Squares The three types o regresso that have bee preseted,.e. smple lear, polyomal, ad multple lear ca be epressed a geeral leastsquares model! y a z +a z +a z +...+a m z m where z, z,, z m are m+ deret uctos m+ s the umber o depedet varables + s the umber o data pots The above epresso ca be wrtte a matr orm {! Y }! " Z # $ { A } 3Oct7 4

Geeral Lear Least Squares {! Y }! " Z # $ { A }! % %! " Z # % $ % % % %! "% a a... a m a a... a m......... a a a m!! " Z# T! $ " Z # $ { A }! " Z # T $ # & & & & & & & $ & { Y} {Y} cotas the observed values o the depedet varables [Z] a a matr o the observed values o the depedet varables {A} cotas the ukow coecets # m & S r % y a j z j ( j! $ ' 3Oct7 4

Geeral Lear Least Squares!! " Z# T! $ " Z # $ { A }! " Z # T $ { Y} Soluto strategy LU decomposto Cholesky s method Matr verse approach! { A}! " Z # $! "% T! " Z # # $ $& T! Z " # $ { Y} 3Oct7 4

3Oct7 INTERPOLATION Newto Method Lagrage Method 43

Iterpolato 3Oct7 lear quadratc cubc 44

Iterpolato Stuato Need to estmate termedate values betwee precse data pots. The most commo method used or ths purpose s polyomal terpolato Geeral ormula or a thorder polyomal s! ( ) a +a +a +...+a There s oly oe polyomal o order or less that passes through all + data pots. 3Oct7 45

Iterpolato Soluto or th order polyomal requres + data pots Avalable methods to d th order polyomal that terpolates + data pots are: Newto Method Lagrage Method 3Oct7 46

Lear Iterpolato: Newto Method ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) + () ( ) () ( ) 3Oct7 47

Quadratc Iterpolato: Newto Method ( ) ( ) ( )( ) ( ) ( ) ( )! b b b b b b b b b b b b b b b b b a a a + + + + + + + + " " # " %" $ "" " # "" %" $ ( ) a a a + + ï î ï í ì + b a b b b a b b b a 3Oct7 48

Quadratc Iterpolato: Newto Method ( ) ( ) ( ) ( ) [ ] [ ] [ ],,, b ( ) b ( ) ( ) [ ], b 3Oct7 49

Polyomal Iterpolato: Newto Method ( ) ( ) ( )( ) ( )...... + + + b b b ( ) [ ] [ ] [ ],,...,,...,,, b b b b 3Oct7 5

Polyomal Iterpolato: Newto Method [ ] ( ) ( ) [ ] [ ] [ ] [ ] [ ] [ ],...,,,...,,,,...,,,,,,, k k j j k j j j j ( ) ( ) ( ) [ ] ( )( ) [ ] ( )( ) ( ) [ ],...,,......,,, + + + + 3Oct7 5

Polyomal Iterpolato: Newto Method ( ) Computatoal Steps st d 3rd ( ) [, ] [,, ] [ 3,,, ] ( ) [, ] [ 3,, ] ( ) [ 3, ] 3 3 ( 3 ) 3Oct7 5

Polyomal Iterpolato: Lagrage Method ( ) ( ) ( ) ( ) Õ å ¹ j j j j L L 3Oct7 53

Eample 7 3Oct7 ( ).5 4 3. 5 6 3 6. () 6 5 4 3 3 4 5 6 7 X 54

SPLINE INTERPOLATION Lear Sple Quadratc Sple Cubc Sple 3Oct7 55

Sple Iterpolato For + data pots à thorder terpolatg polyomals There s a case where a ucto s geerally smooth but udergoes a abrupt chage somewhere alog the rego o terest Hgherorder polyomals, >>, ted to swg through wld oscllatos the vcty o a abrupt chage Lowerorder polyomal, <<, mght better represet the data patter Lowerorder polyomals: sple terpolato Lear sples ( ) Quadratc sples ( ) Cubc sples ( 3) 3Oct7 56

Polyomal vs Sple Iterpolatos thorder polyomal»» 3Oct7 57

Lear Sples storder sple: straght le Ordered data pots:,,,, ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) m m m + + +... ( ) ( ) j j m + + slope: 3Oct7 58

Lear Sples Lear sples They are thereore detcal to lear terpolato The drawback o lear sples s that they are ot smooth At data pots where two sples meet (called a kot), the slope chages abruptly The rst dervatve o the ucto s dscotuous at kots The above dececy s overcome by usg hgherorder polyomal sples that esure smoothess at the kots by equatg dervatves at these pots 3Oct7 59

Quadratc Sples Quadratc sples I order to esure that the mth dervatves are cotuous at the kots, a sple o at least m+ order must be used 3rd order polyomals or cubc sples that esure cotuous rst ad secod dervatves are most requetly used practce. The dscotuous thrd ad ourth dervatves caot usually be detected vsually, thus they ca be gored 3Oct7 6

Quadratc Sples Objectve: to derve a dorder polyomal or each terval betwee data pots Those polyomals have to show cotuous rst dervatve at data pots The geeral ormula o a dorder polyomal a + b + c ( ) For + data pots (,,,, ) there are tervals, so that there are 3 ukow costats (a, b, c ;,,, ) to evaluate Requres 3 equatos 3Oct7 6

Quadratc Sples The 3 equatos. The sple curves tersect the kots, thus the sples at ad tervals meet at data pot [, ( )] a a + b + b + c + c ( ) ( ), 3,, ( ) eqs.. The rst sple curve passes through the rst data pot ( ) ad the last sple curve passes through the ed pot ( ) a a + b + b + c + c ( ) ( ) eqs. 3Oct7 6

Quadratc Sples The 3 equatos 3. The gradets (the rst dervatves) o the sple curve at the teror kots are equal! ( ) a+b a! +b a +b, 3,, ( ) eqs. 4. Assume that the secod dervatve s zero at the rst data pot a eq. as a cosequece, the rst two data pots ( ad ) are coected wth a straght le 3Oct7 63

Quadratc Sples The 3 equatos ( ) + + ( ) + 3 3Oct7 64

Cubc Sples Objectve: to derve a 3rdorder polyomal or each terval betwee data pots Those polyomals have to show cotuous rst ad secod dervatves at data pots The geeral ormula o a 3rdorder polyomal ( ) a 3 +b +c +d! For + data pots (,,,, ) there are tervals, so that there are 4 ukow costats (a, b, c, d ;,,, ) to evaluate Requres 4 equatos 3Oct7 65

Cubc Sples The 4 equatos. The sple curves tersect the kots, thus the sples at ad tervals meet at data pot [, ( )] à ( ) eqs.. The rst sple curve passes through the rst data pot ( ) ad the last sple curve passes through the ed pot ( ) à eqs. 3. The gradets (the rst dervatves) o the sple curve at the teror kots are equal à ( ) eqs. 4. The secod dervatves o the sple curve at the teror kots are equal à ( ) eqs. 5. The secod dervatves at the ed kots are zero à eqs. 3Oct7 66

Cubc Sples The 4 equatos The th codto brgs to the ollowg cosequece The sple curves at the rst ad last tervals are straght les the rst two data pots are coected by a straght le the last two data pots are coected by a straght le There s a alteratve codto The secod dervatves at the ed kots are kow 3Oct7 67

Cubc Sples The 4 equatos ( ) + + ( ) + ( ) + 4 It s possble to do mathematcal mapulatos so that the cubc sple that requres ( ) equatos to evaluate à reer to Chapra ad Caale (99), pp. 395396. 3Oct7 68

Cubc Sples ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )( ) ( ) ( ) ( ) ( )( ) ( ) 3 3 6 6 6 6 ú û ù ê ë é + ú û ù ê ë é + + ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) [ ] ( ) ( ) ( ) [ ] + + + + + + + + 6 6!!tervals!! ( )!! ( ) " # $ $ % $ $ ( )!equato ukows at each terval: ( ) ( ) da 3Oct7 69

3Oct7 7