Reputation: 11833
I split AirPassenger data into train and test, fit three different exponential smoothing models on train, and then made prediction on test. What I need is to plot predicted results from all models on test data, along with the original data. Could anyone help with plotting all of them together on one plot? Thanks a lot in advance.
train <- window(AirPassengers, end=1957)
test <- window(AirPassengers, start=1958)
fc1 <- ses(train, h=5)
fc2 <- holt(train, h=5)
fc3 <- hw(train, seasonal='additive')
autoplot(AirPassengers)+??????
Upvotes: 0
Views: 680
Reputation: 270160
Try this:
AP <- cbind(AirPassengers, train, test,
as.ts(fc1)[, 1], as.ts(fc2)[, 1], as.ts(fc3)[, 1])
autoplot(AP)
Upvotes: 1