gnuplot上的Fit异常
我尝试用指数回归绘制数据:gnuplot上的Fit异常,gnuplot,Gnuplot,我尝试用指数回归绘制数据: set terminal postscript enhanced color set output 'fichier.ps' set logscale y set logscale x set format y "10^{%L}" set format x "10^{%L}" set key inside right top set xlabel " lines " set ylabel " Time(nanoseconds)" f(x) = a + b*exp
set terminal postscript enhanced color
set output 'fichier.ps'
set logscale y
set logscale x
set format y "10^{%L}"
set format x "10^{%L}"
set key inside right top
set xlabel " lines "
set ylabel " Time(nanoseconds)"
f(x) = a + b*exp (x)
fit f(x) 'fichier.csv' using 16:17 via a, b
plot 'fichier.csv' using 16:17 with points title "title" lw 3 pt 4 linecolor rgb "#FF0000", f(x) with lines title "regtitle" linecolor rgb "#000000" lw 3
我有一个错误:
Max. number of data points scaled up to: 3072
Undefined value during function evaluation
我运行的是gnuplot4.4
如何解决问题 消息
最大数据点数量放大到:3072
与拟合错误无关,另请参见
拟合错误可能是由于数据错误或参数的初始值设置不当造成的。如果在拟合之前根本没有设置变量,gnuplot会使用1.0初始化变量,这可能会完全关闭。众所周知,指数拟合不稳定,起始值不好。在拟合之前,您可以使用gnuplots
stats
命令了解有关数据的更多信息。您的x
值有多大?exp(x)
是否可能导致溢出?您可以尝试的另一件事是为a
和b
的值设置初始猜测。您只需在发出fit
命令之前设置这些变量即可做到这一点:a=1.0;b=1.0
注意溢出发生在exp(709.)
和exp(710.)
之间,但是您的x
值可能需要小于该值,因为它也会乘以b
,可能大于1。我有时会发生这种情况。然后突然停止,再次工作。。。这真让我伤心。