lecture 20: intro to fitting, least squaresbelz/phys3730/lab20/lecture20.pdf · lecture 20: intro...
TRANSCRIPT
![Page 1: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/1.jpg)
Lecture 20: Intro to Fitting,Least Squares
Physics 3730/6720Fall Semester 2019
A bunch of fittings
![Page 2: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/2.jpg)
Fitting● Purpose: Compare data
to a physical model.● “Model” (Webster) – a
system of postulates, data, and inferences presented as a mathematical description of an entity or state of affairs
● i.e. a functional relationship between variables
![Page 3: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/3.jpg)
Fitting● Simplest case: straight line fit
to data with normally distributed (Gaussian) uncertainties.
● What does this mean?
– Measure quantity x, N times.
– As N → large, parent probability distribution → Gaussian
![Page 4: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/4.jpg)
Gaussian Errors● Note that one
sigma (1s)error interval is not the maximum possible excursion from X
0:
– 32% > 1s
– 4.5% > 2s
– 0.27% > 3s
![Page 5: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/5.jpg)
Use “2/3rds Rule” as a Rough Guide
● Spread of points, error bars consistent with normal error distribution.
s6
s5
s4
s3
s2
s1
Independent variable(assume uncertainty negligible)
dependent
vari
able
![Page 6: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/6.jpg)
● What is the problem here?
Use “2/3rds Rule” as a Rough Guide
![Page 7: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/7.jpg)
● What is the problem here?
Use “2/3rds Rule” as a Rough Guide
![Page 8: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/8.jpg)
Problem of Straight-Line Fitting● Remaining problem: I have a set of points
(x
i,y
i ± s
i)
which I expect to follow a linear relationship y = A + Bx What is my best estimate for the coefficients A, B?
![Page 9: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/9.jpg)
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
![Page 10: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/10.jpg)
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
● To each point, connect a spring. (Imagine spring can only move in y direction.)
![Page 11: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/11.jpg)
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
● To each point, connect a spring. (Imagine spring can only move in y direction.)
● To the other end of the springs attach a rigid rod.
![Page 12: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/12.jpg)
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
● To each point, connect a spring. (Imagine spring can only move in y direction.)
● To the other end of the springs attach a rigid rod.
● What will determine where rod comes to rest?
![Page 13: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/13.jpg)
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
● To each point, connect a spring. (Imagine spring can only move in y direction.)
● To the other end of the springs attach a rigid rod.
● Equilibrium position of rod will minimize potential energy.
![Page 14: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/14.jpg)
replace
With the “chi-squared”
function:
thus replace
The problem of fitting data with normally distributeduncertainties is reduced to a matter of finding the model parameters that minimize the chi-squared.
![Page 15: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/15.jpg)
Chi-squared Minimization
● Today: Do chi-squared minimization by brute-force search of parameter space.
● Thursday/Homework: Look at general analytic (but computation-heavy) solution for “linear functions” of the form:
y = a0 + a
1x1 +a
2x2 + a
3x3 + ...
![Page 16: Lecture 20: Intro to Fitting, Least Squaresbelz/phys3730/lab20/lecture20.pdf · Lecture 20: Intro to Fitting, Least Squares ... The problem of fitting data with normally distributed](https://reader034.vdocument.in/reader034/viewer/2022050404/5f818d7b6119e630d41d41e9/html5/thumbnails/16.jpg)
Additional Reading:
Taylor: An Introduction to Error Analysis
Bevington: Data Reduction and Error Analysis for the Physical Sciences
Press et al, Numerical Recipes