【发布时间】:2015-06-09 07:39:20
【问题描述】:
我是 Gnuplot 的忠实粉丝,现在我想对时间序列使用拟合函数。
我的数据集是这样的:
1.000000 1.000000 0.999795 0.000000 0.000000 0.421927 0.654222 -25.127700 1.000000 1994-08-12
1.000000 2.000000 0.046723 -0.227587 -0.689491 0.328387 1.000000 0.000000 1.000000 1994-08-12
2.000000 1.000000 0.945762 0.000000 0.000000 0.400038 0.582360 -8.624480 1.000000 1995-04-19
2.000000 2.000000 0.060228 -0.056367 -0.680224 0.551019 1.000000 0.000000 1.000000 1995-04-19
3.000000 1.000000 1.016430 0.000000 0.000000 0.574478 0.489638 -3.286880 1.000000 1995-07-15
还有我的合适剧本:
set timefmt "%Y-%m-%d"
set xdata time
set format x "%Y-%m-%d"
f(x)=a+b*x
fit f(x) "model_fit.dat" u 10:($2==2?$4:1/0) via a,b
所以我对时间数据进行了条件拟合。 我的问题是,Gnuplot 拟合函数不适用于时间数据。 我在这里发现了一个类似的问题:Linear regression for time series with Gnuplot 但我不想使用其他软件。而且我也不知道如何将时间值更改为数字,然后再返回....
谁能帮我用 Gnuplot 解决这个问题?
非常感谢!
【问题讨论】:
标签: gnuplot time-series curve-fitting linear-regression