【发布时间】:2021-01-06 07:47:57
【问题描述】:
有问题的数据是时间序列数据。我正在尝试绘制残差值与拟合值的图,但散点图将这些点连接在一起。无论如何我可以摆脱连接线吗? 这是代码:
library(quantmod)
library(fpp2)
#head(fancy)
plot(fancy)
hist(fancy)
f_log = log(fancy)
hist(f_log)
lmod <- tslm(f_log ~ trend + season)
summary(lmod)
#residuals
res <- residuals(lmod)
plot(res, ylab="Residuals",xlab="Year")
plot(res,type = "p", ylab="Residuals",xlab="Year")
plot(lmod$fitted.values,res , xlab = "fitted values")
【问题讨论】: