拟合非线性函数和直方图

时间:2018-10-13 09:45:31

标签: gnuplot

请问我如何拟合非线性函数f(x)= n exp(-u x)+ m exp(-v x)+ b?我认为设置正确的参数存在问题,但我不知道应该如何设置。

n=62.0139;
m=78.0149;
u=0.00663343;
v=0.04652;
b=1.34521;
f(x)=n*exp(-u*x)+m*exp(-v*x)+b

fit f(x) 'absorpcni_krivka_data.txt' via a,b,c,d,e
set xlabel "{/:Italic d} [mg.cm^{-2}]" font "Times New Roman,12"
set ylabel "{/:Italic N} [ ]" font "Times New Roman,12"
set ytics nomirror font "Times New Roman,12"
set xtics nomirror font "Times New Roman,12"
set key top right font "Times New Roman,12"
plot 'absorpcni_krivka_data.txt' title "Naměřené hodnoty" with points pt 7 ps 0.8, f(x)

这是数据文件: http://leteckaposta.cz/718543063

然后我对这些适合度有疑问:

clear
reset


f(x)=a*exp((-(x-b)**2)/(2*c**2))
a=120.546;
b=141.317;
c=12.5889;
fit f(x) 'poisson.txt' via a, sigma, mu

set key off
set border 3
set yzeroaxis
set boxwidth 0.3 absolute
set style fill solid 1.0 noborder

bin_width = 0.1;

bin_number(x) = floor(x/bin_width)

rounded(x) = bin_width * ( bin_number(x) + 0.5 )
set ytics nomirror font "Times New Roman,12"
set xtics nomirror font "Times New Roman,12"
set xlabel "Počet rozpadů" font "Times New Roman,12"
set ylabel "Počet výskytů" font "Times New Roman,12"
plot [40:120] 'poisson.txt' using (rounded($1)):(1) smooth frequency with boxes, f(x)

以下是数据文件的链接:http://leteckaposta.cz/163981582

非常感谢你。

图片错误

enter image description here

0 个答案:

没有答案