Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ARIMA , forecast

    Hallo,
    I am pretty new to STATA and I would like to do a forecast for one year ahead using SARIMA model.
    However, after modelling I am not able to do any forecast.

    I tried fcast compute but of course does not work for SARIMA.
    When I am trying forecast solve I have an info: unrecognized command: forecast

    How to do the forecast for 1 year ahead using SARIMA?
    I am using stata 11.2.

    here is my code:

    generate t=tm(2005m1)+_n-1
    tsset t, monthly
    arima TOTAL, arima(4,1,3) sarima(1,1,1,12)
    predict p, y
    predict r, resid

    and what after that?
    I would be grateful for any help!

    Kind regards,
    Kathy Kinga

  • #2
    Hi Kathy. May be it is too late, but I randomly found your post. Your code is right, the only thing you missed is the following.
    1) Add the following command after the tsset line:
    tsappend, add(12)
    If your last month of your dataset was 2014m12, after running the tsappend command, now you will have new 12 months with missing values to all of your variables except for the t variable.
    2) Assuming that your last month with data was 2014m12, Change the predict command to:
    predict p, y dynamic(tm(2015m1))
    predict r, residuals dynamic(tm(2015m1))
    With the option dynamic, predit will do a dynamic prediction using historic data and also predicted values (when needed) to do a forecast for the 12 months.
    3) YOu can see your real data and the prediction with a tsline graph:
    tsline TOTAL p

    Regards... Alberto.

    Comment


    • #3
      Dear Alberto,
      t
      I read some documents on Arima forecast. But I can not use dynamic forecast for more than one point of time out-of-sample. Fortunately, I randomly found your thread. The problem is I use tsappend,add(120) as you mentioned in your advice. However, dynamic prediction only gives me one-step ahead predicted value (that means only the predicted value of 2015m1 will be created). What should I do to fix it? Thank you in advance!

      Comment


      • #4
        Thong, I saw your email when I was looking for an answer for my question. In case your question is still unanswered, you can use the forecast suite explained here: http://www.stata.com/manuals13/tsforecast.pdf

        This might also be helpful if you want to use predict for dynamic forecast: http://stackoverflow.com/questions/3...le-predictions

        Best,
        Amir

        Comment


        • #5
          Dear Amir,
          Thank you very much for your help. However, I solved the problem for a while ago.

          Comment

          Working...
          X