0

I'm using a forecast() function in R many times with loop (12 months) for but I want to use accuracy to compare forecast for horizon time =12 and one-step ahead. My problem is how to store the results of 12 times to use it in accuracy.

Thank you

MAYA
  • 1,243
  • 1
  • 12
  • 20
  • Please provide [a minimal reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Stephan Kolassa Feb 04 '15 at 07:41
  • here is the code : for ( i in 1:12) { demfit <- ets(Dem2) f<-forecast(demfit,1) Dem2[length(Dem2)+1]=f$mean[1] } accuracy(f,Test) #it's only for the last forecasted value (12) but I'm looking to compute accuracy for 12 forecast. It the same thing for this : fit<-ets(Dem2) f1<-forecast(fit,12) accuracy(f1,Test) – MAYA Feb 04 '15 at 17:00
  • Please read the link I provided, make your example *reproducible* (that is, so we can run it locally), edit it into your question and explain what exactly you want. Thank you. – Stephan Kolassa Feb 04 '15 at 17:07

0 Answers0