0

I used autoplot() function to plot a time series data including the arima forecast from the forecast() function. The x-axis of the plot is wrong. The data is used xts from 2000/01/01 to 2019/09/01, but obviously the result is not using this time.

fed.arima <- auto.arima(FEDFUNDS_ts)
fore1 <- forecast(fed.arima,level = c(95),h=12)
plot(fore1)
autoplot(fore1)

plot(fore1)

enter image description here

Sang won kim
  • 524
  • 5
  • 21

1 Answers1

0

Maybe your time data is character type. So change time or date type data.

Example :

str(data)
'data.frame':   ~ obs. of  ~ variables:
 $ Time: chr  "2017/7/1" "2017/7/2" "2017/7/3" "2017/7/4 " ...

library(lubridate)
data$Time<-ymd(data$Time)
str(data)
'data.frame':   ~ obs. of  ~ variables:
 $ Time: Date, format  "2017-7-1" "2017-7-2" "2017-7-3" "2017-7-4 " ...

And try to do make plot.

Sang won kim
  • 524
  • 5
  • 21