Skip to content

Instantly share code, notes, and snippets.

@philippstroehle
Created August 19, 2013 07:03
Show Gist options
  • Save philippstroehle/6266370 to your computer and use it in GitHub Desktop.
Save philippstroehle/6266370 to your computer and use it in GitHub Desktop.
#R #arima #forecast
require(forecast)
resultsAR = NULL
resultsMA = NULL
# start a loop here and feed it new data
tmp = data$Value
tmp = tmp[1:100]
fit = auto.arima(tmp)
str(fit)
fit$model
# to get the AR-part
ar = fit$model["phi"]
ma = fit$model["theta"]
resultsAR = rbind(resultsAR, ar)
resultsMA = rbind(resultsMA, ma)
# end of loop
#writing the results to files
write.csv(resultsAR, "resultsAR")
write.csv(resultsMA, "resultsMA")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment