summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Fitting.hs
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2014-04-30 16:10:20 +0200
committerAlberto Ruiz <aruiz@um.es>2014-04-30 16:10:20 +0200
commitcf1379fed234cf99b2ccce6d9311bfc5c58ef4a3 (patch)
tree2532837500eb98af048404e33018fa88d8a7f535 /lib/Numeric/GSL/Fitting.hs
parentb8b7b47450a1007d4d8c77bb7d04e2744c3bfcd4 (diff)
improved documentation
Diffstat (limited to 'lib/Numeric/GSL/Fitting.hs')
-rw-r--r--lib/Numeric/GSL/Fitting.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Numeric/GSL/Fitting.hs b/lib/Numeric/GSL/Fitting.hs
index 6343b76..c4f3a91 100644
--- a/lib/Numeric/GSL/Fitting.hs
+++ b/lib/Numeric/GSL/Fitting.hs
@@ -13,7 +13,8 @@ Nonlinear Least-Squares Fitting
13 13
14The example program in the GSL manual (see examples/fitting.hs): 14The example program in the GSL manual (see examples/fitting.hs):
15 15
16@dat = [ 16@
17dat = [
17 ([0.0],([6.0133918608118675],0.1)), 18 ([0.0],([6.0133918608118675],0.1)),
18 ([1.0],([5.5153769909966535],0.1)), 19 ([1.0],([5.5153769909966535],0.1)),
19 ([2.0],([5.261094606015287],0.1)), 20 ([2.0],([5.261094606015287],0.1)),
@@ -25,8 +26,9 @@ expModel [a,lambda,b] [t] = [a * exp (-lambda * t) + b]
25expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]] 26expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]]
26 27
27(sol,path) = fitModelScaled 1E-4 1E-4 20 (expModel, expModelDer) dat [1,0,0] 28(sol,path) = fitModelScaled 1E-4 1E-4 20 (expModel, expModelDer) dat [1,0,0]
29@
28 30
29\> path 31>>> path
30(6><5) 32(6><5)
31 [ 1.0, 76.45780563978782, 1.6465931240727802, 1.8147715267618197e-2, 0.6465931240727797 33 [ 1.0, 76.45780563978782, 1.6465931240727802, 1.8147715267618197e-2, 0.6465931240727797
32 , 2.0, 37.683816318260355, 2.858760367632973, 8.092094813253975e-2, 1.4479636296208662 34 , 2.0, 37.683816318260355, 2.858760367632973, 8.092094813253975e-2, 1.4479636296208662
@@ -34,10 +36,10 @@ expModelDer [a,lambda,b] [t] = [[exp (-lambda * t), -t * a * exp(-lambda*t) , 1]
34 , 4.0, 5.630494933603935, 5.021755718065913, 0.10287787128056883, 1.0338835440862608 36 , 4.0, 5.630494933603935, 5.021755718065913, 0.10287787128056883, 1.0338835440862608
35 , 5.0, 5.443976278682909, 5.045204331329302, 0.10405523433131504, 1.019416067207375 37 , 5.0, 5.443976278682909, 5.045204331329302, 0.10405523433131504, 1.019416067207375
36 , 6.0, 5.4439736648994685, 5.045357818922331, 0.10404905846029407, 1.0192487112786812 ] 38 , 6.0, 5.4439736648994685, 5.045357818922331, 0.10404905846029407, 1.0192487112786812 ]
37\> sol 39>>> sol
38[(5.045357818922331,6.027976702418132e-2), 40[(5.045357818922331,6.027976702418132e-2),
39(0.10404905846029407,3.157045047172834e-3), 41(0.10404905846029407,3.157045047172834e-3),
40(1.0192487112786812,3.782067731353722e-2)]@ 42(1.0192487112786812,3.782067731353722e-2)]
41 43
42-} 44-}
43----------------------------------------------------------------------------- 45-----------------------------------------------------------------------------