lecture 4: fitting straight lines by the least-squares methodbelz/phys3719/lecture04.pdf · 24...
TRANSCRIPT
Lecture 4: Fitting Straight Lines by the Least-Squares Method
Physics 3719Spring Semester 2011
M.Shattuck,CUNY,
Ideal ParticleImage
24 January 2011 Physics 3719, Lecture 04 2
Problem of Straight-Line Fitting
● We have discussed and seen examples of linearization of data, in which we recast mathematical relations between variables in straight-line form– Easy to recognize by eye– Easy to fit
24 January 2011 Physics 3719, Lecture 04 3
Transform to Linear: Basic Idea
x = independent variabley = dependent variable
slope intercept
24 January 2011 Physics 3719, Lecture 04 4
Transform to Linear: Example
24 January 2011 Physics 3719, Lecture 04 5
Problem of Straight-Line Fitting● Remaining problem: I have a set of points
(x
i,y
i ±
i)
which I expect to follow a linear relationship y = A + Bx What is my best estimate for the coefficients A, B?
24 January 2011 Physics 3719, Lecture 04 6
1st: Mechanical Analog● Suppose we have a set of
points (xi,y
i).
24 January 2011 Physics 3719, Lecture 04 7
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.)
24 January 2011 Physics 3719, Lecture 04 8
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.
24 January 2011 Physics 3719, Lecture 04 9
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?
24 January 2011 Physics 3719, Lecture 04 10
Equilibrium position of rod will minimize potential energy.
24 January 2011 Physics 3719, Lecture 04 11
where
define
In terms of stretch of string
then
24 January 2011 Physics 3719, Lecture 04 12
Discussion
● To what does the spring constant k correspond in our linear fitting problem?
● Must the ki all be the same?
24 January 2011 Physics 3719, Lecture 04 13
replace
With the “chi-squared” function:
thus replace
24 January 2011 Physics 3719, Lecture 04 14
Minimization of 2
Solve two equations in two unknownsSee handouts for results.
24 January 2011 Physics 3719, Lecture 04 15
Application left for homework
exercise!
24 January 2011 Physics 3719, Lecture 04 16
Accuracy and Precision/Statistical and Systematic
24 January 2011 Physics 3719, Lecture 04 17
Uncertainties in Experimental Physics
● Freshman physics:– 90% of time is spent measuring
central value– Compare to “accepted value”– Tack on experimental uncertainty as an
afterthought, if at all.
● Undergrad Lab (and the rest of your careers):– Spend most of your time understanding errors– Before you even touch equipment!– Is experiment worth doing? Will someone fund it?
24 January 2011 Physics 3719, Lecture 04 18
Terminology...
● Accuracy: How close to True value?
● Precision: What is the spread you'd see in repeated measurements?
24 January 2011 Physics 3719, Lecture 04 19
More terminology...
● Random or Statistical Error: Can be reduced by taking more measurements
● Systematic Error: Cannot be reduced by taking more measurements
● Q: When is an experiment “finished”?
24 January 2011 Physics 3719, Lecture 04 20
24 January 2011 Physics 3719, Lecture 04 21