gnuplot 帮助点与方程不匹配

问题描述 投票:0回答:1

我正在绘制一个带有点的函数。但他们不匹配。这是我的脚本。

set terminal svg size 600, 320 font 'Arial,10'
set xlabel 'Amount'
set ylabel 'Response'
set grid
set xrange [*:*]
set yrange [*:*]
set samples (100 - 1)/1 + 1
f(x) = -.00460160431126948 + (x * .159907884344821) + ((x**2) * 0)
plot f(x) with lines lw 3 linecolor rgb 'purple' notitle, '-' with points ls 7 linecolor rgb 'orange' notitle
0 13.33
.2 582.23333
1 2746.95
10 26147.62333
50 131314.39667
75.000001875 192126.03
100 259905.49333
e

gnuplot
1个回答
0
投票

gnuplot 可以选择将函数拟合到某些数据(检查

help fit
)。

如果你有一个二次函数,例如

f(x) = a*x**2 + b*x + c
,您可以找到最适合您数据的
a,b,c
。看来你的价值观
a,b,c
完全偏离了。

脚本:

### fitting
reset session

$Data <<EOD
  0                 13.33
  0.2              582.23333
  1               2746.95
 10              26147.62333
 50             131314.39667
 75.000001875   192126.03
100             259905.49333
EOD

f(x) = a*x**2 + b*x + c
set fit nolog
fit f(x) $Data u 1:2 via a,b,c

plot $Data u 1:2 w p pt 7 lc "orange", \
     f(x) w l lw 3 lc "purple"
### end of script

结果:

Final set of parameters            Asymptotic Standard Error
=======================            ==========================
a               = -0.0123093       +/- 0.6177       (5018%)
b               = 2589.97          +/- 58.01        (2.24%)
c               = 186.967          +/- 790.1        (422.6%)

© www.soinside.com 2019 - 2024. All rights reserved.