SlideShare a Scribd company logo
1 of 28
The Art of Curve Fitting
Anshumaan Bajpai
10/28/2015
1
The Rebuke
2
“With four parameters I
can fit an elephant, and
with five I can make him
wiggle his trunk”
Theoretical Physicist,
Cornell University
Freeman Dyson
“I think it's almost true without
exception if you want to win a Nobel
Prize, you should have a long attention
span, get hold of some deep and
important problem and stay with it for
ten years. That wasn't my style”
Enrico Fermi Richard Dawkins
--- John Von Neumann
“Freeman Dyson is in the
tradition of Lord Kelvin &
Fred Hoyle: physicists who
foolishly barge into biology
& pull rank”
Evolutionary Biologist,
University of Oxford
Italian Physicist,
Columbia University
Manhattan Project
 plotted theoretical graphs of
mesonproton scattering
 Calculations agreed with
Fermi’s measured numbers
--- Dawkins on twitter
Search for the holy elephant
3
 Neumann made the comment before 1953 but he never
demonstrated how to fit an elephant and neither did Fermi
 Many tried but failed and it wasn’t until 2010 when a
research group from Germany published:
Content
 What exactly are we trying to fit?
 Models at our disposal
 Obtaining the fitting function
 Testing the accuracy of model
 Improving the model
4
What exactly are we fitting ?
5
What exactly are we fitting ?
6
What exactly are we fitting ?
7
 Is this model correct ?
 However, what if the data plotted here
was generated using:
 If you answer NO, then the probability
that you are right is very high
𝑌 = 𝑓(𝑋 𝑛)
 Should I go to higher order polynomials ?
 Yes!!
 If I know that my data collection/generation
has no error, and assuming I know its
functional form (polynomial, log, trigonometric
function), the parameters should be tuned to
get the most accurate fit
What exactly are we fitting ?
8
 In most practical conditions, there will be
errors in the measurement
 Instrument least count
 Lack of all the variables in the
model
𝑆 =
1
2
𝑔𝑡2
𝑆 =
1
2
𝑔𝑡2 + 𝑓(𝜂)
𝑌 = 𝑓 𝑋
𝑌 = 𝑓 𝑋 + 𝜖
 f represents the systematic information
that X provides about Y, whereas є is the
random error term
9
What exactly are we fitting ?
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
10
What exactly are we fitting ?
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
11
What exactly are we fitting ?
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
+ 𝜖
12
What exactly are we fitting ?
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
+ 𝜖
What exactly are we fitting ?
13
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
+ 𝜖
Data availableWe need
Why Estimate f ?
14
𝑌 = 𝑓 𝑋3
, 𝑋2
, 𝑋1
, 𝑋0
+ 𝜖
Data availableWe need
 Prediction
𝑌′ = 𝑓′ 𝑋
 Inference
 How does Y depend on X ?
 We do need to estimate f but the is
not necessarily to make predictions
on Y
𝐸(𝑌 − 𝑌′)2= 𝐸[𝑓 𝑋 + 𝜖 − 𝑓′(𝑋)]2
= [𝑓 𝑋 − 𝑓′(𝑋)]2+𝑉𝑎𝑟(𝜖)
Reducible Irreducible
How do we estimate f ?
15
 Parametric approaches
 Make an assumption about the functional form of f
 Then perform a least square fitting to obtain the parameters
 Easy to estimate the parameters once we assume a certain functional form
 The assumed functional form would usually not match true f
 Non-parametric approaches
 No specific functional form of f is assumed
 Attempt is made to come up with a functional form that fits that data as well as possible without
being too rough
 Is more likely to estimate the true functional form
 Needs lots and lots of data points
𝑓 𝑋 = 𝑎0 + 𝑎1 𝑋 + 𝑎2 𝑋2
+ ⋯ + 𝑎 𝑝 𝑋 𝑝
Accuracy vs Interpretability
16An Introduction to statistical learning with Applications in R
Is our model accurate ?
17
𝑀𝑒𝑎𝑛 𝑆𝑞𝑢𝑎𝑟𝑒𝑑 𝐸𝑟𝑟𝑜𝑟(𝑀𝑆𝐸) =
1
𝑛
𝑖=1
𝑛
(𝑦𝑖 − 𝑓′
(𝑥𝑖) )2
Training data Testing dataTraining MSE Testing MSE
Bias-Variance trade off
18
 One basic inference from a U–shaped/Convex dependency ?
𝐸((𝑦0) − 𝑓′(𝑋0))2= 𝑉𝑎𝑟 𝑓′ 𝑋0 + [𝐵𝑖𝑎𝑠(𝑓′ 𝑋0 )]2+𝑉𝑎𝑟(𝜖)
Expected Test MSE
 Flexible methods
 High Variance
 Low bias
 Rigid methods
 High bias
 Low variance
Improving the Model
19
 Learning Curves
 Bootstrapping
 Identifying Non linearity in data
 Non constant variance of error terms
Learning Curves
20
Quadratic fit
𝐸((𝑦0) − 𝑓′
(𝑋0))2
= 𝑉𝑎𝑟 𝑓′
𝑋0 + [𝐵𝑖𝑎𝑠(𝑓′
𝑋0 )]2
+𝑉𝑎𝑟(𝜖)
Expected Test MSE High biasHigh var
Learning Curves: High Bias
21
Linear fit The model inadequately fits the training data
 Increasing the training set size won’t help
 Need to increase the flexibility of the model
Learning Curves: High Variance
22
Gap
 The model overfits fits the training data
 Do not need to increase the model flexibility
 Need to increase the size of training set
Bootstrapping
23
𝑌 ≈ 𝛽0 + 𝛽1 𝑋
𝑌′ = 𝛽0
′
+ 𝛽1
′
𝑋
𝛽′
= (𝑥 𝑇
𝑥)−1
𝑥 𝑇
y
Population regression line
 When we assume a linear model:
 We take a sample set from the population:
 Using linear algebra:
𝑅𝑆𝑆 =
𝑖=1
𝑛
(𝑦𝑖 − 𝑦𝑖
′)2
Least square fit
An Introduction to statistical learning with Applications in R
Nonlinearity of the data
24An Introduction to statistical learning with Applications in R
Non Constant variance of Error terms
25An Introduction to statistical learning with Applications in R
Take away message
 Learning Curves are an excellent way to find out if I need more data
or do I need to change our model
 Bootstrapping provides a better estimate of true parameters
 Model fitting should be supported by residual plots, they are always
worth the time
26
Thank You
27
References:
• Enrico_fermi : http://www.biography.com/people/enrico-fermi-9293405
• Freeman Dyson: https://www.sns.ias.edu/faculty
• Freeman Dyson_happy: http://www.weheartdiving.com/page/3/
• Freeman Dyson _bored: http://jqi.umd.edu/news/phil-schewes-book-published
• Jon Neumann: http://207.44.136.17/celebrity/John_Von_Neumann/
• Art: http://www.pickywallpapers.com/1600x900/miscellaneous/drawings/recursive-hand-drawing-
wallpaper/download/
28

More Related Content

What's hot

Scatter plots
Scatter plotsScatter plots
Scatter plotsMs. Jones
 
G6 m1-b-lesson 15-t
G6 m1-b-lesson 15-tG6 m1-b-lesson 15-t
G6 m1-b-lesson 15-tmlabuski
 
G6 m2-d-lesson 19-t
G6 m2-d-lesson 19-tG6 m2-d-lesson 19-t
G6 m2-d-lesson 19-tmlabuski
 
G6 m4-a-lesson 1-s
G6 m4-a-lesson 1-sG6 m4-a-lesson 1-s
G6 m4-a-lesson 1-smlabuski
 
Tafe presentation1
Tafe presentation1Tafe presentation1
Tafe presentation1Laugonzalez3
 
StatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxStatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxSERC at Carleton College
 
(8) Inquiry Lab - Composition of Transformations
(8) Inquiry Lab - Composition of Transformations(8) Inquiry Lab - Composition of Transformations
(8) Inquiry Lab - Composition of Transformationswzuri
 
Coursera 1week
Coursera  1weekCoursera  1week
Coursera 1weekcsl9496
 
Real life application of Enginneering mathematics
Real life application of Enginneering mathematicsReal life application of Enginneering mathematics
Real life application of Enginneering mathematicsNasrin Rinky
 
The Error Bound on SLLN
The Error Bound on SLLNThe Error Bound on SLLN
The Error Bound on SLLNguest8e0f17
 
The Error Bound on SLLN
The Error Bound on SLLNThe Error Bound on SLLN
The Error Bound on SLLNguest8e0f17
 
2.6 find the whole and 3.1 divide multi digit whole numbers
2.6 find the whole and 3.1 divide multi digit whole numbers2.6 find the whole and 3.1 divide multi digit whole numbers
2.6 find the whole and 3.1 divide multi digit whole numbersAmna Abunamous
 

What's hot (16)

Group 1
Group 1Group 1
Group 1
 
D.e.v
D.e.vD.e.v
D.e.v
 
Time Series
Time SeriesTime Series
Time Series
 
Scatter plots
Scatter plotsScatter plots
Scatter plots
 
G6 m1-b-lesson 15-t
G6 m1-b-lesson 15-tG6 m1-b-lesson 15-t
G6 m1-b-lesson 15-t
 
G6 m2-d-lesson 19-t
G6 m2-d-lesson 19-tG6 m2-d-lesson 19-t
G6 m2-d-lesson 19-t
 
G6 m4-a-lesson 1-s
G6 m4-a-lesson 1-sG6 m4-a-lesson 1-s
G6 m4-a-lesson 1-s
 
Tafe presentation1
Tafe presentation1Tafe presentation1
Tafe presentation1
 
StatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptxStatVignette03_Sig.Figs_v04_07_15_2020.pptx
StatVignette03_Sig.Figs_v04_07_15_2020.pptx
 
(8) Inquiry Lab - Composition of Transformations
(8) Inquiry Lab - Composition of Transformations(8) Inquiry Lab - Composition of Transformations
(8) Inquiry Lab - Composition of Transformations
 
Applications of numerical methods
Applications of numerical methodsApplications of numerical methods
Applications of numerical methods
 
Coursera 1week
Coursera  1weekCoursera  1week
Coursera 1week
 
Real life application of Enginneering mathematics
Real life application of Enginneering mathematicsReal life application of Enginneering mathematics
Real life application of Enginneering mathematics
 
The Error Bound on SLLN
The Error Bound on SLLNThe Error Bound on SLLN
The Error Bound on SLLN
 
The Error Bound on SLLN
The Error Bound on SLLNThe Error Bound on SLLN
The Error Bound on SLLN
 
2.6 find the whole and 3.1 divide multi digit whole numbers
2.6 find the whole and 3.1 divide multi digit whole numbers2.6 find the whole and 3.1 divide multi digit whole numbers
2.6 find the whole and 3.1 divide multi digit whole numbers
 

Viewers also liked

Polynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABPolynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABShameer Ahmed Koya
 
Curve Fitting results 1110
Curve Fitting results 1110Curve Fitting results 1110
Curve Fitting results 1110Ray Wang
 
Summer Intern Project
Summer Intern ProjectSummer Intern Project
Summer Intern ProjectRahul Thukral
 
Applied numerical methods lec8
Applied numerical methods lec8Applied numerical methods lec8
Applied numerical methods lec8Yasser Ahmed
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fittingAmeen San
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittingsTarun Gehlot
 
Passive and active sensors
Passive and active sensorsPassive and active sensors
Passive and active sensorsVivek Srivastava
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline InterpolationaiQUANT
 
Sensors for remote sensing
Sensors for remote sensingSensors for remote sensing
Sensors for remote sensingMohsin Siddique
 
Sulphate attack
Sulphate attackSulphate attack
Sulphate attackKrishnagnr
 
Applied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
Applied Numerical Methods Curve Fitting: Least Squares Regression, InterpolationApplied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
Applied Numerical Methods Curve Fitting: Least Squares Regression, InterpolationBrian Erandio
 
Durability of concrete
Durability of concreteDurability of concrete
Durability of concreteShan Joy
 
Remote Sensing Platforms and Sensors
Remote Sensing Platforms and SensorsRemote Sensing Platforms and Sensors
Remote Sensing Platforms and SensorsUday kumar Devalla
 
Sulphate attack
Sulphate attackSulphate attack
Sulphate attackchazza1234
 
Hudco Construction Techniques
Hudco Construction TechniquesHudco Construction Techniques
Hudco Construction TechniquesUday Yadav
 
chapter 5 - money and banking for BBA
chapter 5 - money and banking for BBAchapter 5 - money and banking for BBA
chapter 5 - money and banking for BBAginish9841502661
 
Central Banking (RBI)
Central Banking (RBI)Central Banking (RBI)
Central Banking (RBI)Ashish Nangla
 

Viewers also liked (20)

Polynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLABPolynomials and Curve Fitting in MATLAB
Polynomials and Curve Fitting in MATLAB
 
Curve fitting
Curve fitting Curve fitting
Curve fitting
 
Curve Fitting results 1110
Curve Fitting results 1110Curve Fitting results 1110
Curve Fitting results 1110
 
Summer Intern Project
Summer Intern ProjectSummer Intern Project
Summer Intern Project
 
Applied numerical methods lec8
Applied numerical methods lec8Applied numerical methods lec8
Applied numerical methods lec8
 
Matlab polynimials and curve fitting
Matlab polynimials and curve fittingMatlab polynimials and curve fitting
Matlab polynimials and curve fitting
 
Curve fitting
Curve fittingCurve fitting
Curve fitting
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittings
 
Passive and active sensors
Passive and active sensorsPassive and active sensors
Passive and active sensors
 
Spline Interpolation
Spline InterpolationSpline Interpolation
Spline Interpolation
 
Sensors for remote sensing
Sensors for remote sensingSensors for remote sensing
Sensors for remote sensing
 
Sulphate attack
Sulphate attackSulphate attack
Sulphate attack
 
Applied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
Applied Numerical Methods Curve Fitting: Least Squares Regression, InterpolationApplied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
Applied Numerical Methods Curve Fitting: Least Squares Regression, Interpolation
 
Durability of concrete
Durability of concreteDurability of concrete
Durability of concrete
 
HUDCO
HUDCOHUDCO
HUDCO
 
Remote Sensing Platforms and Sensors
Remote Sensing Platforms and SensorsRemote Sensing Platforms and Sensors
Remote Sensing Platforms and Sensors
 
Sulphate attack
Sulphate attackSulphate attack
Sulphate attack
 
Hudco Construction Techniques
Hudco Construction TechniquesHudco Construction Techniques
Hudco Construction Techniques
 
chapter 5 - money and banking for BBA
chapter 5 - money and banking for BBAchapter 5 - money and banking for BBA
chapter 5 - money and banking for BBA
 
Central Banking (RBI)
Central Banking (RBI)Central Banking (RBI)
Central Banking (RBI)
 

Similar to 151028_abajpai1

Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning BasicsDeep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning BasicsJason Tsai
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Codiax
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithmsArunangsu Sahu
 
Dive into the Data
Dive into the DataDive into the Data
Dive into the Datadr_jp_ebejer
 
Slides econometrics-2017-graduate-2
Slides econometrics-2017-graduate-2Slides econometrics-2017-graduate-2
Slides econometrics-2017-graduate-2Arthur Charpentier
 
Introduction to simulating data to improve your research
Introduction to simulating data to improve your researchIntroduction to simulating data to improve your research
Introduction to simulating data to improve your researchDorothy Bishop
 
SPSS statistics - get help using SPSS
SPSS statistics - get help using SPSSSPSS statistics - get help using SPSS
SPSS statistics - get help using SPSScsula its training
 
Module-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data scienceModule-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data sciencepujashri1975
 
Machine Learning, Financial Engineering and Quantitative Investing
Machine Learning, Financial Engineering and Quantitative InvestingMachine Learning, Financial Engineering and Quantitative Investing
Machine Learning, Financial Engineering and Quantitative InvestingShengyuan Wang Steven
 
Ijarcet vol-2-issue-4-1579-1582
Ijarcet vol-2-issue-4-1579-1582Ijarcet vol-2-issue-4-1579-1582
Ijarcet vol-2-issue-4-1579-1582Editor IJARCET
 
Non Conventional Methods for Solving Equations
Non Conventional Methods for Solving EquationsNon Conventional Methods for Solving Equations
Non Conventional Methods for Solving EquationsMHS
 
Understanding Blackbox Prediction via Influence Functions
Understanding Blackbox Prediction via Influence FunctionsUnderstanding Blackbox Prediction via Influence Functions
Understanding Blackbox Prediction via Influence FunctionsSEMINARGROOT
 
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Sherri Gunder
 
Statistical Methods
Statistical MethodsStatistical Methods
Statistical Methodsguest2137aa
 
Statistical Methods
Statistical MethodsStatistical Methods
Statistical Methodsguest9fa52
 
Demystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffDemystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffAshwin Rao
 

Similar to 151028_abajpai1 (20)

PREDICT 422 - Module 1.pptx
PREDICT 422 - Module 1.pptxPREDICT 422 - Module 1.pptx
PREDICT 422 - Module 1.pptx
 
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning BasicsDeep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
 
Lecture 1.pdf
Lecture 1.pdfLecture 1.pdf
Lecture 1.pdf
 
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
Sean Holden (University of Cambridge) - Proving Theorems_ Still A Major Test ...
 
Pattern Discovery - part I
Pattern Discovery - part IPattern Discovery - part I
Pattern Discovery - part I
 
Essentials of machine learning algorithms
Essentials of machine learning algorithmsEssentials of machine learning algorithms
Essentials of machine learning algorithms
 
Dive into the Data
Dive into the DataDive into the Data
Dive into the Data
 
Slides econometrics-2017-graduate-2
Slides econometrics-2017-graduate-2Slides econometrics-2017-graduate-2
Slides econometrics-2017-graduate-2
 
Introduction to simulating data to improve your research
Introduction to simulating data to improve your researchIntroduction to simulating data to improve your research
Introduction to simulating data to improve your research
 
SPSS statistics - get help using SPSS
SPSS statistics - get help using SPSSSPSS statistics - get help using SPSS
SPSS statistics - get help using SPSS
 
Module-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data scienceModule-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data science
 
Machine Learning, Financial Engineering and Quantitative Investing
Machine Learning, Financial Engineering and Quantitative InvestingMachine Learning, Financial Engineering and Quantitative Investing
Machine Learning, Financial Engineering and Quantitative Investing
 
Ijarcet vol-2-issue-4-1579-1582
Ijarcet vol-2-issue-4-1579-1582Ijarcet vol-2-issue-4-1579-1582
Ijarcet vol-2-issue-4-1579-1582
 
Non Conventional Methods for Solving Equations
Non Conventional Methods for Solving EquationsNon Conventional Methods for Solving Equations
Non Conventional Methods for Solving Equations
 
Understanding Blackbox Prediction via Influence Functions
Understanding Blackbox Prediction via Influence FunctionsUnderstanding Blackbox Prediction via Influence Functions
Understanding Blackbox Prediction via Influence Functions
 
Multiple linear regression
Multiple linear regressionMultiple linear regression
Multiple linear regression
 
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
 
Statistical Methods
Statistical MethodsStatistical Methods
Statistical Methods
 
Statistical Methods
Statistical MethodsStatistical Methods
Statistical Methods
 
Demystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance TradeoffDemystifying the Bias-Variance Tradeoff
Demystifying the Bias-Variance Tradeoff
 

151028_abajpai1

  • 1. The Art of Curve Fitting Anshumaan Bajpai 10/28/2015 1
  • 2. The Rebuke 2 “With four parameters I can fit an elephant, and with five I can make him wiggle his trunk” Theoretical Physicist, Cornell University Freeman Dyson “I think it's almost true without exception if you want to win a Nobel Prize, you should have a long attention span, get hold of some deep and important problem and stay with it for ten years. That wasn't my style” Enrico Fermi Richard Dawkins --- John Von Neumann “Freeman Dyson is in the tradition of Lord Kelvin & Fred Hoyle: physicists who foolishly barge into biology & pull rank” Evolutionary Biologist, University of Oxford Italian Physicist, Columbia University Manhattan Project  plotted theoretical graphs of mesonproton scattering  Calculations agreed with Fermi’s measured numbers --- Dawkins on twitter
  • 3. Search for the holy elephant 3  Neumann made the comment before 1953 but he never demonstrated how to fit an elephant and neither did Fermi  Many tried but failed and it wasn’t until 2010 when a research group from Germany published:
  • 4. Content  What exactly are we trying to fit?  Models at our disposal  Obtaining the fitting function  Testing the accuracy of model  Improving the model 4
  • 5. What exactly are we fitting ? 5
  • 6. What exactly are we fitting ? 6
  • 7. What exactly are we fitting ? 7  Is this model correct ?  However, what if the data plotted here was generated using:  If you answer NO, then the probability that you are right is very high 𝑌 = 𝑓(𝑋 𝑛)  Should I go to higher order polynomials ?  Yes!!  If I know that my data collection/generation has no error, and assuming I know its functional form (polynomial, log, trigonometric function), the parameters should be tuned to get the most accurate fit
  • 8. What exactly are we fitting ? 8  In most practical conditions, there will be errors in the measurement  Instrument least count  Lack of all the variables in the model 𝑆 = 1 2 𝑔𝑡2 𝑆 = 1 2 𝑔𝑡2 + 𝑓(𝜂) 𝑌 = 𝑓 𝑋 𝑌 = 𝑓 𝑋 + 𝜖  f represents the systematic information that X provides about Y, whereas є is the random error term
  • 9. 9 What exactly are we fitting ? 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0
  • 10. 10 What exactly are we fitting ? 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0
  • 11. 11 What exactly are we fitting ? 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0 + 𝜖
  • 12. 12 What exactly are we fitting ? 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0 + 𝜖
  • 13. What exactly are we fitting ? 13 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0 + 𝜖 Data availableWe need
  • 14. Why Estimate f ? 14 𝑌 = 𝑓 𝑋3 , 𝑋2 , 𝑋1 , 𝑋0 + 𝜖 Data availableWe need  Prediction 𝑌′ = 𝑓′ 𝑋  Inference  How does Y depend on X ?  We do need to estimate f but the is not necessarily to make predictions on Y 𝐸(𝑌 − 𝑌′)2= 𝐸[𝑓 𝑋 + 𝜖 − 𝑓′(𝑋)]2 = [𝑓 𝑋 − 𝑓′(𝑋)]2+𝑉𝑎𝑟(𝜖) Reducible Irreducible
  • 15. How do we estimate f ? 15  Parametric approaches  Make an assumption about the functional form of f  Then perform a least square fitting to obtain the parameters  Easy to estimate the parameters once we assume a certain functional form  The assumed functional form would usually not match true f  Non-parametric approaches  No specific functional form of f is assumed  Attempt is made to come up with a functional form that fits that data as well as possible without being too rough  Is more likely to estimate the true functional form  Needs lots and lots of data points 𝑓 𝑋 = 𝑎0 + 𝑎1 𝑋 + 𝑎2 𝑋2 + ⋯ + 𝑎 𝑝 𝑋 𝑝
  • 16. Accuracy vs Interpretability 16An Introduction to statistical learning with Applications in R
  • 17. Is our model accurate ? 17 𝑀𝑒𝑎𝑛 𝑆𝑞𝑢𝑎𝑟𝑒𝑑 𝐸𝑟𝑟𝑜𝑟(𝑀𝑆𝐸) = 1 𝑛 𝑖=1 𝑛 (𝑦𝑖 − 𝑓′ (𝑥𝑖) )2 Training data Testing dataTraining MSE Testing MSE
  • 18. Bias-Variance trade off 18  One basic inference from a U–shaped/Convex dependency ? 𝐸((𝑦0) − 𝑓′(𝑋0))2= 𝑉𝑎𝑟 𝑓′ 𝑋0 + [𝐵𝑖𝑎𝑠(𝑓′ 𝑋0 )]2+𝑉𝑎𝑟(𝜖) Expected Test MSE  Flexible methods  High Variance  Low bias  Rigid methods  High bias  Low variance
  • 19. Improving the Model 19  Learning Curves  Bootstrapping  Identifying Non linearity in data  Non constant variance of error terms
  • 20. Learning Curves 20 Quadratic fit 𝐸((𝑦0) − 𝑓′ (𝑋0))2 = 𝑉𝑎𝑟 𝑓′ 𝑋0 + [𝐵𝑖𝑎𝑠(𝑓′ 𝑋0 )]2 +𝑉𝑎𝑟(𝜖) Expected Test MSE High biasHigh var
  • 21. Learning Curves: High Bias 21 Linear fit The model inadequately fits the training data  Increasing the training set size won’t help  Need to increase the flexibility of the model
  • 22. Learning Curves: High Variance 22 Gap  The model overfits fits the training data  Do not need to increase the model flexibility  Need to increase the size of training set
  • 23. Bootstrapping 23 𝑌 ≈ 𝛽0 + 𝛽1 𝑋 𝑌′ = 𝛽0 ′ + 𝛽1 ′ 𝑋 𝛽′ = (𝑥 𝑇 𝑥)−1 𝑥 𝑇 y Population regression line  When we assume a linear model:  We take a sample set from the population:  Using linear algebra: 𝑅𝑆𝑆 = 𝑖=1 𝑛 (𝑦𝑖 − 𝑦𝑖 ′)2 Least square fit An Introduction to statistical learning with Applications in R
  • 24. Nonlinearity of the data 24An Introduction to statistical learning with Applications in R
  • 25. Non Constant variance of Error terms 25An Introduction to statistical learning with Applications in R
  • 26. Take away message  Learning Curves are an excellent way to find out if I need more data or do I need to change our model  Bootstrapping provides a better estimate of true parameters  Model fitting should be supported by residual plots, they are always worth the time 26
  • 28. References: • Enrico_fermi : http://www.biography.com/people/enrico-fermi-9293405 • Freeman Dyson: https://www.sns.ias.edu/faculty • Freeman Dyson_happy: http://www.weheartdiving.com/page/3/ • Freeman Dyson _bored: http://jqi.umd.edu/news/phil-schewes-book-published • Jon Neumann: http://207.44.136.17/celebrity/John_Von_Neumann/ • Art: http://www.pickywallpapers.com/1600x900/miscellaneous/drawings/recursive-hand-drawing- wallpaper/download/ 28