9. Data Fitting Fitting Experimental Spectrum Fitting Exponential Decay Theory: Probability & Statistics Least-Square Fitting Calling LAPACK from C
9.1. Fitting Experimental Spectrum Two types of techniques for fitting data : Interpolation: polynomials passing through all data points. Least-squares: model with adjustable parameters. Model :
Lagrange Interpolation nth order polynomial passing through n + 1 data points { ( xi , fi ) ; i = 0,1,...,n } : where i j k i , x 1 2 4 f(x) 12 24 60 E.g.
Assuming f describe the 1st n derivatives exactly, then the remainder theorem gives : Ex. 9.1. Do § 9.1.2.
Cubic Splines Ref: D.Kincaid, W.Cheney, "Numerical Analysis", § 6.4, Brook (1991) Given a set of n + 1 data points { ( xi , yi ) ; i = 0,1,..., n }, the cubic spline S(x) interpolates each of the n intervals with a 3rd degree polynomial such that S passes through all n + 1 data points. f & f are continuous in all n 1 interior points. # of parameters = P = 4 n. # of constraints = C = 2n + 2(n 1) = 4n 2 Natural spline : S 0 = S n = 0
For Si on interval [ xi , xi+1 ] : Since Si is a 3rd degree polynomial, Si is linear in x. where
With z0 = zn = 0, is a tri-diagonal linear system for the unknowns { zi ; i = 1,..., n1 } Once it’s solved, say, by Gaussian elimination ( Thomas algorithm ), one has Ex. 9.2. Do a spline fit for the cross section data ( see § 9.1.5).
9.2. Fitting Exponential Decay Theory : stochastic events: Task: ‘Fit’ theory to experimental data by choosing the ‘best’ values of N0 and .
9.3. Theory: Probability & Statistics Basics ( discrete events ) : Probability P(x) of event x (occurring) : 0 P(x) 1. 1 P(x) Probability of event x not occurring. In the sampling of a population, P(x) of a particular sample having value x is : Mean value of a function f(x) is :
Binomial Distribution Let the probability of success in each trial be p. After N trials, the probability of having succeeded x times is
Gaussian & Poisson Distribution See F.Reif, “Fundamentals of Statistical & Thermal Physics, §1.6 & Prob 1.9. As N while Np remains finite, PB becomes the Gaussian distribution As N while p 0, PB becomes the Poisson distribution
9.4. Least-Square Fitting Given ND data points { xi , yi ± i } , i = 1,..., ND , & a model function g(x) = g(x; {m} ) of Np parameters m, m = 1,..., Np, find the values of {m} by minimizing Thus, m = 1,..., Np Ex. 9.3. Do Exercise in § 9.4.4.
Linear Regression
To minimize subtractive cancellation error, let where
Nonlinear Fit of Breit-Wigner to Cross Section Breit-Wigner resonance formula :
9.5. Calling LAPACK from C