Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. library(forecast)
  2.  
  3. retail <- read.csv("https://robjhyndman.com/data/ausretail.csv",header=FALSE)
  4. retail <- ts(retail[,-1],f=12,s=1982+3/12)
  5.  
  6. ns <- ncol(retail)
  7. h <- 24
  8. fcast <- matrix(NA,nrow=h,ncol=ns)
  9. for(i in 1:ns)
  10. fcast[,i] <- forecast(retail[,i],h=h)$mean
  11.  
  12. write(t(fcast),file="retailfcasts.csv",sep=",",ncol=ncol(fcast))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement