[R] Saving forecast.Arima as data

Rui Barradas ruipbarradas at sapo.pt
Thu Jul 11 10:41:44 CEST 2013


Hello,

Try the following.

fr <- forecast.Arima(y0,h=3)
fr[["mean"]]


Hope this helps,

Rui Barradas

Em 11-07-2013 08:04, Lasse Thorst escreveu:
> Hi
>
> I am setting up a simple time series model, and I need the forecast to be saved in a format I later easily can work with/load into a database. The model will run once a day on new input and hence I want how it has performed to be easy to work with. The output for forecast.Arima(ts) or for example predict(ts) gives something that is easy to read, but I haven't been able to get it into a data.frame or as a vector or something similar.
>
> Example: forecasting 2 variables:
>
>> forecast.Arima(y0,h=3)
>
>        Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
> 80.71          30.96 27.98 33.95 26.40 35.53
> 80.86          30.71 26.88 34.55 24.84 36.58
> 81.00          30.76 26.41 35.10 24.11 37.40
>
>> forecast.Arima(y1,h=3)
>
>        Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
> 80.71          27.98 24.63 31.33 22.85 33.11
> 80.86          28.07 23.79 32.36 21.52 34.63
> 81.00          28.09 23.27 32.90 20.72 35.45
>
> Now I want to just extract the forecast (ex. 30.96, 30.71, 30.76) - How can I do that?
>
> Kind Regards,
> Lasse Thorst
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list