Created
August 19, 2013 07:03
-
-
Save philippstroehle/6266370 to your computer and use it in GitHub Desktop.
#R #arima #forecast
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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