You are on page 1of 4

NLinear fitting - bi-dimensional Gaussian model

Iteration max
100

f ( x, c) c4 exp[ (c x c2 x c3 x1 x2 )]
2
1 1

2
2

This model has 2 dimensions x =[x1, x2]


and 4 parameters c = [c1, c2, c3, c4]
x1

x2
-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4

0
0.1
0.2
0.3
0.3
0.2
0.1
0.1
0.5
1

y
1.55760157
1.61631227
1.58589225
1.4713012
1.54828394
1.80967484
1.94477673
1.90055734
1.08670174
0.18510116

Param.
c1
c2
c3
c4

Starting

Using the macro "Fit" is simple


insert the starting values in the range H7:H10.
Select the XY data of the range A7:C16 and press
the buttom "Fit"

Derivatives of this model are:


f
c4 x12 exp[ (c1 x12 c2 x22 c3 x1 x2 )]
c1
f
c4 x22 exp[ (c1 x12 c2 x22 c3 x1 x2 )]
c2
f
c4 x1 x2 exp[ (c1 x12 c2 x22 c3 x1 x2 )]
c3
f
exp[ (c1 x12 c2 x22 c3 x1 x2 )]
c4

Final
1
1
0
1

1
2.5
-0.7
2

Iteration max
best regression

2 ( y f (x,c))2
y regress
1.55760157
1.61631227
1.58589225
1.4713012
1.54828394
1.80967484
1.94477673
1.90055734
1.08670174
0.18510116

ssr
0

x1

x2
-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4

y
0
0.1
0.2
0.3
0.3
0.2
0.1
0.1
0.5
1

1.557601566
1.616312274
1.585892247
1.471301202
1.548283938
1.809674836
1.944776734
1.900557341
1.086701738
0.185101155

y*
1.557602903
1.61631265
1.585891876
1.471300406
1.548282671
1.809672985
1.944774771
1.900555839
1.086701527
0.185101382
1.39366E-11

c1
c2
c3
c4

0.999992211
2.499998345
-0.69999853
1.999997822

start

true
1
1
0
1

1
2.5
-0.7
2

You might also like