# How to extract values of the forecasted times series of auto.arima [closed]

I'm working actually on the modeling of times series with auto.arima from package forecasts. But i enconter some problems regarding the extraction of values Lo 80, Hi 80, Lo 95, Hi 95 singularly. I have retrieved data to excel with function csv but it 's too long and there are some risks to loose data. I have retrieved only the mean or the point forecast with the function AA11a[["mean"]] as you can see on my codes in R

a<-ts(AA,start=1921,end=2009,frequency=1)
fit11a<-auto.arima(b,allowdrift=TRUE)
AA11a<-forecast(fit11a,50)
plot(AA11a)
plot(AA11a[["mean"]])


I want to ask how can i extract the Lo 80, Hi 80, Lo 95, Hi 95 singularly? I have tried this code AA11a$fcst$AA[,1]

but it doesn't work and tell me : Null

The other alternative is to send the output AA11a to excel and find singularly variables but before exploring that path i will ask whether somebody has an idea on how to extract different values i have cited above with codes in R. Thanks

You didn't provide your data. So I am guessing what you are looking for: I think you want to get something like this:

> library(forecast)
> fit=Arima(WWWusage,c(3,1,0))
> AA11a<-forecast(fit)
> AA11a$lower 80% 95% [1,] 215.7393 213.6634 [2,] 209.9265 205.0016 [3,] 203.8380 196.1947 [4,] 198.3212 188.2489 [5,] 193.2807 180.8498 [6,] 188.3324 173.4858 [7,] 183.3651 166.0860 [8,] 178.5027 158.8474 [9,] 173.8431 151.8879 [10,] 169.3780 145.1874 > AA11a$upper
80%      95%
[1,] 223.5823 225.6582
[2,] 228.5332 233.4581
[3,] 232.7151 240.3585
[4,] 236.3756 246.4479
[5,] 240.2458 252.6768
[6,] 244.4246 259.2713
[7,] 248.6473 265.9264
[
[9,] 256.7919 278.7471
[10,] 260.7719 284.9625
> AA11a$upper[1,2] 95% 225.6582 > AA11a$lower[,2]
[1] 213.6634 205.0016 196.1947 188.2489 180.8498 173.4858 166.0860 158.8474
[9] 151.8879 145.1874
>

• Thanks so much. Codes you provide me are working at 100%. Thanks Jan 18, 2014 at 1:08

To extract the mean of the prediction interval as a numeric vector use:

> as.numeric(AA11a$mean) [1] 219.6608 219.2299 218.2766 217.3484 216.7633 216.3785 216.0062 215.6326 215.3175 [10] 215.0749  The mean itself is a tsclass > class(AA11a$mean)
[1] "ts"

• Thanks, lost half na hour on that! Other question, I see the residuals, and the timeseries actuals (x) are there, but is there a column with the historical predictions? or do I have to create a new column x+residual if I want to plot both? Thanks Nov 2, 2017 at 23:53