SlideShare a Scribd company logo
St. John's University of Tanzania
MAT210 NUMERICAL ANALYSIS
2013/14 Semester II
REGRESSION
Linear Regression
Kaw, Chapter 6.03
MAT210 2013/14 Sem II 2 of 19
●
Linear regression = most popular model
●
A measure of goodness of fit, that is, how well
the line predicts the response variable y at
each of the n data points
●
Ideally, if all the residuals are 0, then all points
are on the line. Therefore
●
Minimization of the residual is an objective of
obtaining the best regression coefficients
Introduction
y=a0
+a1
x
Residual ,Ei
=yi
−(a0
+a1
xi)
MAT210 2013/14 Sem II 3 of 19
Least Squares Fit
● Most popular method to minimize residual
●
Least squares methods
– Estimates of the constants of the models are chosen
such that the sum of squared residuals is minimized
● To find Sr, minimize it relative to a0 and a1
Sr
=∑
i=1
i=n
Ei
2
=∑
i=1
i=n
(yi
−(a0
+a1
xi
))
2
MAT210 2013/14 Sem II 4 of 19
Lots of sums
∂Sr
∂a0
=2∑
i=1
i=n
(yi
−(a0
+a1
xi
))(−1)=0
∂Sr
∂a1
=2∑
i=1
i=n
(yi
−(a0
+a1
xi
))(−xi
)=0
∑
i=1
i=n
yi
−∑
i=1
i=n
a0
+∑
i=1
i=n
a1
xi
=0
∑
i=1
i=n
yi
xi
−∑
i=1
i=n
a0
xi
+∑
i=1
i=n
a1
xi
2
=0
which leads to
MAT210 2013/14 Sem II 5 of 19
Not as bad as it looks
∑
i=1
i=n
a0
is simply na0
a0
n+a1∑
i=1
i=n
xi
=∑
i=1
i=n
yi
a0∑
i=1
i=n
xi
+a1∑
i=1
i=n
xi
2
=∑
i=1
i=n
yi
xi
which leads to
now we are getting somewhere
MAT210 2013/14 Sem II 6 of 19
Two equations, two unknowns
a1
=
n∑
i=1
i=n
xi
yi
−∑
i=1
i=n
xi ∑
i=1
i=n
yi
n∑
i=1
i=n
xi
2
−
(∑
i=1
i=n
xi)
2
a0
=
∑
i=1
i=n
xi
2
∑
i=1
i=n
yi
−∑
i=1
i=n
xi ∑
i=1
i=n
xi
yi
n∑
i=1
i=n
xi
2
−
(∑
i=1
i=n
xi)
2
Solving the two equations yields
MAT210 2013/14 Sem II 7 of 19
Clean-up with means, variances
MAT210 2013/14 Sem II 8 of 19
Example: Torque (T)
The torque T needed to turn the torsional
spring of a mousetrap through an angle θ
MAT210 2013/14 Sem II 9 of 19
Tabulating data
Not too hard with a spreadsheet
MAT210 2013/14 Sem II 10 of 19
Calculating k2
MAT210 2013/14 Sem II 11 of 19
Calculating k1
MAT210 2013/14 Sem II 12 of 19
End Result
0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
0.10
0.15
0.20
0.25
0.30
0.35
0.40
Angle, radians
Torque,N-m
MAT210 2013/14 Sem II 13 of 19
Example: Stress vs Strain
Longitudinal modulus of a composite material
MAT210 2013/14 Sem II 14 of 19
Using your head
● Note that stress of 0 produces 0 strain
Force the line to go through 0,0
MAT210 2013/14 Sem II 15 of 19
Simplified result
MAT210 2013/14 Sem II 16 of 19
Tabulated Data
MAT210 2013/14 Sem II 17 of 19
Finding the Elastic Modulus, E
MAT210 2013/14 Sem II 18 of 19
MAT210 2013/14 Sem II 19 of 19
The Modern World
● Spreadsheets and other data analysis tools,
including GnuPlot and Scilab, eliminate the
need for doing hand calculations
●
That is good news, because it means we
focus less on mechanics and more on
intellect
● Understanding the model
– Must the line go through (0,0)?
– Is the right model a line?
– What about data errors? Invalid points?

More Related Content

What's hot

Geometry 5-10 Day 2
Geometry 5-10 Day 2Geometry 5-10 Day 2
Geometry 5-10 Day 2Mr. Parisi
 
3.1 Naming and Measuring Angles
3.1 Naming and Measuring Angles3.1 Naming and Measuring Angles
3.1 Naming and Measuring Angles
smiller5
 
Graphing Absolute Value Functions
Graphing Absolute Value FunctionsGraphing Absolute Value Functions
Graphing Absolute Value Functions
ms.stedman
 
Forecasting
ForecastingForecasting
Forecasting
Nilanjan Bhaumik
 
My favorite online teaching tool
My favorite online teaching toolMy favorite online teaching tool
My favorite online teaching tool
littlebay
 
Representation of data on map by proportional circles
Representation of data on map by proportional circlesRepresentation of data on map by proportional circles
Representation of data on map by proportional circles
Subhasish Sutradhar
 
2.8 a absolute value functions
2.8 a absolute value functions2.8 a absolute value functions
2.8 a absolute value functionsfthrower
 
April 15, 2015
April 15, 2015April 15, 2015
April 15, 2015khyps13
 
Analytical geometry
Analytical geometryAnalytical geometry
Analytical geometry
Siyavula
 
Trigonometric functions in standard position slide 1
Trigonometric functions in standard position slide 1Trigonometric functions in standard position slide 1
Trigonometric functions in standard position slide 1Jessica Garcia
 
Stress Mohr's circle
Stress Mohr's circleStress Mohr's circle
Stress Mohr's circle
KingJyeWong
 
Matrices and row operations 12123 and applications of matrices
Matrices and row operations 12123 and applications of matricesMatrices and row operations 12123 and applications of matrices
Matrices and row operations 12123 and applications of matricesmayaGER
 
3º mat pc_e_03_septiembre-alumno
3º mat pc_e_03_septiembre-alumno3º mat pc_e_03_septiembre-alumno
3º mat pc_e_03_septiembre-alumno
varadir1983
 
Week 1 discussion : Systems of linear equations
Week 1 discussion :  Systems of linear equationsWeek 1 discussion :  Systems of linear equations
Week 1 discussion : Systems of linear equations
Skye Lucion
 
8 teorema phytagoras 2
8 teorema phytagoras 28 teorema phytagoras 2
8 teorema phytagoras 2
Eva Nurmalasari
 
Qwizdom a-level maths - trig equations 1
Qwizdom   a-level maths - trig equations 1Qwizdom   a-level maths - trig equations 1
Qwizdom a-level maths - trig equations 1
Qwizdom UK
 

What's hot (19)

Geometry 5-10 Day 2
Geometry 5-10 Day 2Geometry 5-10 Day 2
Geometry 5-10 Day 2
 
3.1 Naming and Measuring Angles
3.1 Naming and Measuring Angles3.1 Naming and Measuring Angles
3.1 Naming and Measuring Angles
 
Graphing Absolute Value Functions
Graphing Absolute Value FunctionsGraphing Absolute Value Functions
Graphing Absolute Value Functions
 
c language programing
c language programing c language programing
c language programing
 
Forecasting
ForecastingForecasting
Forecasting
 
My favorite online teaching tool
My favorite online teaching toolMy favorite online teaching tool
My favorite online teaching tool
 
Representation of data on map by proportional circles
Representation of data on map by proportional circlesRepresentation of data on map by proportional circles
Representation of data on map by proportional circles
 
2.8 a absolute value functions
2.8 a absolute value functions2.8 a absolute value functions
2.8 a absolute value functions
 
April 15, 2015
April 15, 2015April 15, 2015
April 15, 2015
 
Analytical geometry
Analytical geometryAnalytical geometry
Analytical geometry
 
Trigonometric functions in standard position slide 1
Trigonometric functions in standard position slide 1Trigonometric functions in standard position slide 1
Trigonometric functions in standard position slide 1
 
Math12 lesson4
Math12 lesson4Math12 lesson4
Math12 lesson4
 
Stress Mohr's circle
Stress Mohr's circleStress Mohr's circle
Stress Mohr's circle
 
Matrices and row operations 12123 and applications of matrices
Matrices and row operations 12123 and applications of matricesMatrices and row operations 12123 and applications of matrices
Matrices and row operations 12123 and applications of matrices
 
3º mat pc_e_03_septiembre-alumno
3º mat pc_e_03_septiembre-alumno3º mat pc_e_03_septiembre-alumno
3º mat pc_e_03_septiembre-alumno
 
Tangencias1
Tangencias1Tangencias1
Tangencias1
 
Week 1 discussion : Systems of linear equations
Week 1 discussion :  Systems of linear equationsWeek 1 discussion :  Systems of linear equations
Week 1 discussion : Systems of linear equations
 
8 teorema phytagoras 2
8 teorema phytagoras 28 teorema phytagoras 2
8 teorema phytagoras 2
 
Qwizdom a-level maths - trig equations 1
Qwizdom   a-level maths - trig equations 1Qwizdom   a-level maths - trig equations 1
Qwizdom a-level maths - trig equations 1
 

Similar to SJUT/Mat210/Regression/Linear 2013-14S2

SJUT/MAT210/Interpolation/Splines 2013-14S2
SJUT/MAT210/Interpolation/Splines 2013-14S2SJUT/MAT210/Interpolation/Splines 2013-14S2
SJUT/MAT210/Interpolation/Splines 2013-14S2
John Ham
 
Mc1020
Mc1020Mc1020
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
CHENNAKESAVA KADAPA
 
MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14
John Ham
 
7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)
Faisal F Rafat
 
Finding Dense Subgraphs
Finding Dense SubgraphsFinding Dense Subgraphs
Finding Dense Subgraphs
Carlos Castillo (ChaTo)
 
SJUT/Mat210/Regression/Intro 2013-14S2
SJUT/Mat210/Regression/Intro 2013-14S2SJUT/Mat210/Regression/Intro 2013-14S2
SJUT/Mat210/Regression/Intro 2013-14S2John Ham
 
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
John Ham
 
Design Considerations for AASHTO Flexible pavement design
Design Considerations for AASHTO Flexible pavement designDesign Considerations for AASHTO Flexible pavement design
Design Considerations for AASHTO Flexible pavement design
Imran Nawaz
 
Lec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrencesLec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrences
Ankita Karia
 
MAT210/DiffEq/ODE/FiniteDiff 2013-14
MAT210/DiffEq/ODE/FiniteDiff 2013-14MAT210/DiffEq/ODE/FiniteDiff 2013-14
MAT210/DiffEq/ODE/FiniteDiff 2013-14
John Ham
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Lahiru Danushka
 
Lect 03 Smith charts.pdf
Lect 03 Smith charts.pdfLect 03 Smith charts.pdf
Lect 03 Smith charts.pdf
Ahmed Salem
 
Novel unified finite element schemes for computational solid mechanics based ...
Novel unified finite element schemes for computational solid mechanics based ...Novel unified finite element schemes for computational solid mechanics based ...
Novel unified finite element schemes for computational solid mechanics based ...
CHENNAKESAVA KADAPA
 

Similar to SJUT/Mat210/Regression/Linear 2013-14S2 (14)

SJUT/MAT210/Interpolation/Splines 2013-14S2
SJUT/MAT210/Interpolation/Splines 2013-14S2SJUT/MAT210/Interpolation/Splines 2013-14S2
SJUT/MAT210/Interpolation/Splines 2013-14S2
 
Mc1020
Mc1020Mc1020
Mc1020
 
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
Inf-Sup Stable Displacement-Pressure Combinations for Isogeometric Analysis o...
 
MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14MAT210/Integration/Basic 2013-14
MAT210/Integration/Basic 2013-14
 
7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)
 
Finding Dense Subgraphs
Finding Dense SubgraphsFinding Dense Subgraphs
Finding Dense Subgraphs
 
SJUT/Mat210/Regression/Intro 2013-14S2
SJUT/Mat210/Regression/Intro 2013-14S2SJUT/Mat210/Regression/Intro 2013-14S2
SJUT/Mat210/Regression/Intro 2013-14S2
 
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2SJUT/Mat210/Interpolation/Newton's Divided Difference  2013-14S2
SJUT/Mat210/Interpolation/Newton's Divided Difference 2013-14S2
 
Design Considerations for AASHTO Flexible pavement design
Design Considerations for AASHTO Flexible pavement designDesign Considerations for AASHTO Flexible pavement design
Design Considerations for AASHTO Flexible pavement design
 
Lec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrencesLec 5 asymptotic notations and recurrences
Lec 5 asymptotic notations and recurrences
 
MAT210/DiffEq/ODE/FiniteDiff 2013-14
MAT210/DiffEq/ODE/FiniteDiff 2013-14MAT210/DiffEq/ODE/FiniteDiff 2013-14
MAT210/DiffEq/ODE/FiniteDiff 2013-14
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
 
Lect 03 Smith charts.pdf
Lect 03 Smith charts.pdfLect 03 Smith charts.pdf
Lect 03 Smith charts.pdf
 
Novel unified finite element schemes for computational solid mechanics based ...
Novel unified finite element schemes for computational solid mechanics based ...Novel unified finite element schemes for computational solid mechanics based ...
Novel unified finite element schemes for computational solid mechanics based ...
 

Recently uploaded

2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
Mohammed Sikander
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 

Recently uploaded (20)

2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Multithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race conditionMultithreading_in_C++ - std::thread, race condition
Multithreading_in_C++ - std::thread, race condition
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 

SJUT/Mat210/Regression/Linear 2013-14S2

  • 1. St. John's University of Tanzania MAT210 NUMERICAL ANALYSIS 2013/14 Semester II REGRESSION Linear Regression Kaw, Chapter 6.03
  • 2. MAT210 2013/14 Sem II 2 of 19 ● Linear regression = most popular model ● A measure of goodness of fit, that is, how well the line predicts the response variable y at each of the n data points ● Ideally, if all the residuals are 0, then all points are on the line. Therefore ● Minimization of the residual is an objective of obtaining the best regression coefficients Introduction y=a0 +a1 x Residual ,Ei =yi −(a0 +a1 xi)
  • 3. MAT210 2013/14 Sem II 3 of 19 Least Squares Fit ● Most popular method to minimize residual ● Least squares methods – Estimates of the constants of the models are chosen such that the sum of squared residuals is minimized ● To find Sr, minimize it relative to a0 and a1 Sr =∑ i=1 i=n Ei 2 =∑ i=1 i=n (yi −(a0 +a1 xi )) 2
  • 4. MAT210 2013/14 Sem II 4 of 19 Lots of sums ∂Sr ∂a0 =2∑ i=1 i=n (yi −(a0 +a1 xi ))(−1)=0 ∂Sr ∂a1 =2∑ i=1 i=n (yi −(a0 +a1 xi ))(−xi )=0 ∑ i=1 i=n yi −∑ i=1 i=n a0 +∑ i=1 i=n a1 xi =0 ∑ i=1 i=n yi xi −∑ i=1 i=n a0 xi +∑ i=1 i=n a1 xi 2 =0 which leads to
  • 5. MAT210 2013/14 Sem II 5 of 19 Not as bad as it looks ∑ i=1 i=n a0 is simply na0 a0 n+a1∑ i=1 i=n xi =∑ i=1 i=n yi a0∑ i=1 i=n xi +a1∑ i=1 i=n xi 2 =∑ i=1 i=n yi xi which leads to now we are getting somewhere
  • 6. MAT210 2013/14 Sem II 6 of 19 Two equations, two unknowns a1 = n∑ i=1 i=n xi yi −∑ i=1 i=n xi ∑ i=1 i=n yi n∑ i=1 i=n xi 2 − (∑ i=1 i=n xi) 2 a0 = ∑ i=1 i=n xi 2 ∑ i=1 i=n yi −∑ i=1 i=n xi ∑ i=1 i=n xi yi n∑ i=1 i=n xi 2 − (∑ i=1 i=n xi) 2 Solving the two equations yields
  • 7. MAT210 2013/14 Sem II 7 of 19 Clean-up with means, variances
  • 8. MAT210 2013/14 Sem II 8 of 19 Example: Torque (T) The torque T needed to turn the torsional spring of a mousetrap through an angle θ
  • 9. MAT210 2013/14 Sem II 9 of 19 Tabulating data Not too hard with a spreadsheet
  • 10. MAT210 2013/14 Sem II 10 of 19 Calculating k2
  • 11. MAT210 2013/14 Sem II 11 of 19 Calculating k1
  • 12. MAT210 2013/14 Sem II 12 of 19 End Result 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 0.10 0.15 0.20 0.25 0.30 0.35 0.40 Angle, radians Torque,N-m
  • 13. MAT210 2013/14 Sem II 13 of 19 Example: Stress vs Strain Longitudinal modulus of a composite material
  • 14. MAT210 2013/14 Sem II 14 of 19 Using your head ● Note that stress of 0 produces 0 strain Force the line to go through 0,0
  • 15. MAT210 2013/14 Sem II 15 of 19 Simplified result
  • 16. MAT210 2013/14 Sem II 16 of 19 Tabulated Data
  • 17. MAT210 2013/14 Sem II 17 of 19 Finding the Elastic Modulus, E
  • 18. MAT210 2013/14 Sem II 18 of 19
  • 19. MAT210 2013/14 Sem II 19 of 19 The Modern World ● Spreadsheets and other data analysis tools, including GnuPlot and Scilab, eliminate the need for doing hand calculations ● That is good news, because it means we focus less on mechanics and more on intellect ● Understanding the model – Must the line go through (0,0)? – Is the right model a line? – What about data errors? Invalid points?