Search code examples
rstatisticsanalyticsforecastingarima

How should I get the forecasted values in R using Arima Model?


I am new to R so doesn't know how exactly the forecasting works in R using Arima Model. I have a dataset is like: 92 Aug-17 9533 93 Sep-17 8718 94 Oct-17 2035 95 Nov-17 2539 96 Dec-17 1333 97 Jan-18 2444 98 Feb-18 9371 99 Mar-18 9697 100 Apr-18 3989 101 May-18 4061 102 Jun-18 2797 103 Jul-18 2949

I want see the forecasted values for next 12 months by using arima model in R. So how should I achieve this.

Thanks in Advance. this is a dataset


Solution

  • Suppose you have fitted your ARIMA model in fit

    so you can use the following method for predicting values. Here n is the number of values you want to predict. In your case, n will be 12.

    pred = predict(fit,n.ahead = 1*n)
    

    If you are taking log of values during ARIMA modeling so you use the following method for actual output.

    values = 2.718^pred$pred