在r中移动绘图线
我想移动红色图,以与浅蓝色图重叠。
try1 = ts(validation_noSnoT, frequency = 7)
ses <- ets(ts(train_noSnoT, frequency = 7), model = "ANA")
ses.pred <- predict(ses, h = length(try1),level = 0)
ses.pred
plot(ses.pred)
lines(ses.pred$fitted, lwd = 2, col = "blue")
lines(try1,lwd = 2, col = "red")
有人可以帮忙吗?
I am trying to superimpose the plots of the predictions and the actual validation values.
I am getting the following plot
I want to move the red plot to overlap with the light blue plot.
try1 = ts(validation_noSnoT, frequency = 7)
ses <- ets(ts(train_noSnoT, frequency = 7), model = "ANA")
ses.pred <- predict(ses, h = length(try1),level = 0)
ses.pred
plot(ses.pred)
lines(ses.pred$fitted, lwd = 2, col = "blue")
lines(try1,lwd = 2, col = "red")
can someone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我做了以下事情并且它起作用了:
我所做的就是在训练数据结束的地方开始行。所以我必须手动检查这个值并将其插入到 seq() 函数中。由于我的频率是每周
by
设置为 1/7。limit
只是floor(train_per * length(noSnoT))
,其中train_per
是整个数据集的训练数据百分比So i did the following and it worked:
What i did was to start the lines at where my training data ended. So I had to check this value manually and insert it in the seq() function. As my frequency was weekly
by
was set to 1/7.limit
is justfloor(train_per * length(noSnoT))
wheretrain_per
is the training data percentage of the entire dataset