【问题标题】:How to do a fit with gnuplot using data with error in x and y?如何使用 x 和 y 中有错误的数据与 gnuplot 进行拟合?
【发布时间】:2015-12-01 13:07:01
【问题描述】:

如何拟合 x y deltax delta y 之类的数据?我必须对两个轴的误差进行线性拟合,确切的语法是什么?

通过abxyerrorbars 匹配f (x) "file.txt" u1:2:3:4

f (x) =a*x + b

结果:invert_RtR 中的奇异矩阵

【问题讨论】:

  • xyerrorbar 样式用于绘图。您不能给 with 样式进行拟合。

标签: gnuplot data-fitting


【解决方案1】:

由于没有您事先尝试过的代码,因此我们可以对其进行编辑,因此我在这里提供了一个非常通用的解决方案。

对于线性拟合,在 fit 命令中使用 using (1) 以获得相等的权重。有关 fit 命令语法的示例,see this one。当然,the manual 拥有fitusing 的完整详细信息。

【讨论】:

    【解决方案2】:

    要适应 x 和 y 错误,您需要 gnuplot 5。然后使用语法

    f(x) = a*x + b
    fit f(x) "file.txt" using 1:2:3:4 xyerrors via a,b
    

    完整的演示请参见http://gnuplot.sourceforge.net/demo_5.0/fit.html 上的最后一个示例。

    【讨论】:

    • 我有 gnuplot 5 我会试试
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-07
    • 2015-07-01
    • 1970-01-01
    • 2018-02-28
    • 2020-10-08
    • 2015-11-08
    相关资源
    最近更新 更多