Вы находитесь на странице: 1из 12

Curve tting

Ramkumar R
February 7, 2013
Ramkumar R Curve tting
Ramkumar R Curve tting

Random variables

Probability functions

Discrete PMF

CDF
F
X
(x) = Prob{X x} (1)

PDF
f
X
(x) = F

(x) (2)
Ramkumar R Curve tting
Moments

Central moment (x )
m
= (x x)
m

Zeroth and First 1 and 0

Second Variance
2
= (x x)
2
= x
2
x
2

Third and Fourth Skewness and Kurtosis

Non-central moment X
m

Ramkumar R Curve tting


Gaussian (Normal)
f
X
(x) =
1

2
exp
_

(x )
2
2
2
_
(3)
Ramkumar R Curve tting
Chi-square PDF
Q =
k

i =1
X
2
i
(4)
f
Q
(x; k) =
_
1
2
k/2
(k/2)
x
k/2 1
e
x/2
; x 0
0 ; x < 0
(5)
where X
i
s are normallly distributed random variables with 0 mean
and variance 1.
Ramkumar R Curve tting
Chi-square CDF
After integration, we get the Chi-square CDF in terms of an lower
incomplete function dened as
(s, x) =
_
x
0
t
s1
e
t
dt (6)
Then the Chi-square CDF equals
(
k
2
,

2
2
)
(
k
2
)
(7)
Ramkumar R Curve tting
What does curve tting mean?

Fitting data to a model with adjustable parameters

Design gure-of-merit function

Obtain best t parameters by adjusting parameters to achieve


min in merit function

More details to take care of

Assess appropriateness of model; goodness-of-t

Accuracy of parameter determination

Merit function may not be unimodal


Ramkumar R Curve tting
Least squares tting
Maximizing the product
P
N

i =1
exp
_

1
2
_
y
i
y
i (t)

_
2
_
y (8)
ie. Minimizing its negative logarithm
_
N

i =1
[y
i
y
i (t)
]
2
2
2
_
N log y (9)
Minimizing this sum over a
1
, a
2
, ..a
M
, we get the nal form:
N

i =1
[y
i
y
i (t)
]
2
(10)
Ramkumar R Curve tting
Chi-square tting
Modifying equation ?? to replace the by
i
and going through
the same process, we get

2
=
N

i =1
_
y
i
y
i (t)

i
_
2
(11)
where
y
i (t)
= f (a
1
, a
2
, ..a
M
) (12)
For models that are linear in the as, however, it turns out that the
probability distribution for dierent values of chi-square at its
minimum can nevertheless be derived analytically, and is the
chi-sqaure distribution for N-M degrees of freedom.
Ramkumar R Curve tting
gnuplot
gnuplot> fit f(x) foo.data u 1:2:3:4 via a, b

Uses WSSR: Weighted Sum of Squared Residuals

Marquardt-Levenberg algorithm to nd parameters to use in


next iteration

After tting, gnuplot reports stdt, the standard deviation of


the t
Ramkumar R Curve tting

Numerical Receipies in C

The gnuplot manual

Miscellanous books on elementary probability

Presentation created using L


A
T
E
X and Beamer
Presentation source code available on github.com/artagnon/curve-tting
Ramkumar R Curve tting

Вам также может понравиться