Title: Lab 4: Least Square Fitting
1Lab 4 Least Square Fitting
2Lab 4 Least Square Fitting
- The most popular approach of linear regression
(yABx) - Linear regression is widely used in biological,
behavioral and social sciences to describe
possible relationships between variables. It is
ranked as one of the most important tools used in
these disciplines. - Based on a set of measurements (xi, yi)
- Calculate parameters A and B.
- Evaluate the quality of the fitting
- Principle of maximum likelihood
3Statistics of a single quantity
Principle of maximum likelihood
4Statistics of the relationship between multiple
quantities
5Calculate A and B with least square fitting
The simplest case
- Assumptions
- for a set of measurements (xi, yi), i1, , N
- Ignore uncertainties of xi (correlated with yi)
- Uncertainty of y follows a Gaussian distribution
w/ true value YiAB?xi, and the same standard
deviation sy (no need to know its value a priori) - Principle of maximum likelihood.
6Calculate A and B with least square fitting
The simplest case
The probability of one measurement (xi, yi) is
The probability of (xi, yi), i1, , N is
Chi square
?2 is a measure of how well the fitting is.
7The simplest case (cont.)
Principle of maximum likelihood
8The simplest case (cont.)
9The simplest case (cont.)
The solution is
No need to know sy!
10Estimate the uncertainty of y
Similar to N measurement of the same quantity
(if we know the true values of A and B)
However, we dont really know the true value of A
and B. Instead, we use the best estimates for A
and B, which reduce the value of above formula
and need to be compensated.
One can always find a line that perfectly passes
through 2 points.
11Uncertainties of A and B
Pr. 8.16
Using error propagation formula
12Weighted Least Square fitting (this lab)e.g. yi
with different uncertainties
13Weighted Least Square fitting
Pr. 8.9
More general case
- Assumptions
- for a set of measurements (xi, yi), i1, , N
- Ignore the uncertainties of xi
- Uncertainties of yis follow Gaussian
distribution w/ true values YiABxi, and
standard deviations si (which are needed for
fitting). - Principle of maximum likelihood.
14Pr. 8.9
Weighted Least Square fitting
More general case
The probability of one measurement (xi, yi) is
The probability of (xi, yi), i1, , N is
Chi square
Different for every i.
15More general case (cont.)
Principle of maximum likelihood
16More general case (cont.)
17Uncertainties of A and B
Pr. 8.19
Using error propagation formula
E.g.
18Uncertainties of A and B (cont.)
19Summary of Least square fitting
Only linear algebra!
- Assumptions
- for a set of measurements (xi, yi), i1, , N
- Uncertainty of y follows Gaussian distribution w/
true value YiABxi, and standard deviation si - Principle of maximum likelihood.
20Lab 4 ? decay of 137Ba
Half life D0.5 D0
Show derivation in your report
Linear regression
21Uncertainty is not constant!
Uncertainty of decay count Di (Poisson)
At time progresses, Di is getting smaller and
smaller.
What is the uncertainty of lnDi ?
22The background radiation
Background radiation is the radiation constantly
present in the natural environment of the Earth,
which is emitted by natural and artificial
sources.
- Sources in the Earth.
- Sources from outer space, such as cosmic rays.
- Sources in the atmosphere, such as the radon gas
released from the Earth's crust.
23Lab 4 Least Square Fitting of decay counts
- One run of decay counts/interval (D) vs. time (t)
- Must start counting shortly after sample is
loaded - Sampling rate 10 second/sample (?t)
- Run time 600 seconds ( of measurements n60).
- Measurement of background radiation
- Wait 20-30 minutes
- Repeat the counting experiment in 1.
- Make sure no other radioactive sources near your
counter - Analyze data
- Subtract background DD-Db, error propagation.
- plot D vs. t and lnD vs. t
- Least square fit and overlap your fitting curves
with data plots. - Origin (OriginLab) is more convenient than
Matlab.