Announcement

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

  • Confidence intervals for ARIMA/ARMA models

    Hii

    I am currently working with an ARIMA and ARMA model, and would love to have a 95% confidence band around my forecast.
    Is it somehow possible to apply it automatically to the graph along with the forecast?

    I am using the arimaasoc code to select the best model for my forecast.
    Thank you in advance.

    Best,
    Maria
    Last edited by Maria Philiposian; 09 Feb 2024, 02:15. Reason: ARIMA

  • #2
    Could you please provide a little more context for your question? Are you referring to confidence intervals related to certain estimates? Currently, you've only mentioned a command for selecting the number of AR and MA lags in an ARMA model.

    Comment


    • #3
      Hi Andrew

      Of course, sorry. I'll attach the code :



      clear all

      import excel "C:\Users\tu4i\OneDrive\D.xlsx", sheet("D") firstrow clear


      *Drop variables*
      drop R U

      *Format data*
      gen months = tm(2021m1)+_n-1
      format %tm months
      tsset months, monthly

      twoway (tsline Home)



      ************************************************** ******************************
      * Autoselektion *
      ************************************************** ******************************

      * Graf *
      *twoway (line Home months, sort), title("Home hours (2021-2023)")

      *arimasoc select the best model *
      arimasoc Home

      regress H L(1/2).H

      *save estimates *
      estimates store home_est

      *Forecast*
      arima Home, arima(2,0,0)
      tsappend, add(12)
      predict fhjem, y dynamic(m(2024m1))
      label variable fhome "Forecast Home"
      twoway (line fhome months) (line Home months)

      Comment


      • #4
        I was specifically thinking about confidence bands like the picture attached and not just lines
        Click image for larger version

Name:	eks.PNG
Views:	1
Size:	17.2 KB
ID:	1743477



        Comment

        Working...
        X