2

This is my first question in a platform of this nature, so please, excuse me if I am nor expressing myself properly. Let's start with the problem:

Data: I am working on a dataset of Household Energy Consumption, and I am working in forecasting future energy consumptions. I have done several models, like Holt Winters, ARIMA and Linear Model. Then I do the forecasting and plot it using:

autoplot(forecast)

Where I get something like this: Plot of forecasting

Now, I would like to plot all the forecasts in the same plot, I have tried with:

autoplot(MonthlyTS_SM1) +
      autolayer(fc_MonthlySM1_LM$mean, color = "blue") +
      autolayer(fc_MonthlyTS_SM1_AR$mean, color = "blue", linetype = "dashed") +
      autolayer(fc_Monthly_SM1_HW3$mean, color = "red") 

But it gives me the following error:

Error: Invalid input: date_trans works with objects of class Date only

Do you know how to do it?

Thank you very much!

  • 3
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Jan 15 '20 at 20:36
  • See https://otexts.com/fpp2/simple-methods.html for an example of how to do it. – Rob Hyndman Jan 15 '20 at 23:37

0 Answers0