Announcement

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

  • command arimasoc is unrecognized

    Dear all,

    I am trying to install arimasoc using the command

    ssc install arimasoc

    But I get

    ssc install: "arimasoc" not found at SSC, type search arimasoc
    (To find all packages at SSC that start with a, type ssc describe a)
    r(601);



    Any help
    Best,
    John (stata 17)

  • #2
    arimasoc is new to v18. not sure about similar in prior versions.
    Last edited by George Ford; 22 Aug 2023, 15:52.

    Comment


    • #3
      I checked this, and you can the same results by:

      Code:
      arima product , 
      estat ic
      
      arima product ,  ma(1)
      estat ic
      
      arima product , ma(1/2)
      estat ic
      
      
      arima product , ar(1)
      estat ic

      Comment


      • #4
        Thank you a lot!. Is there any loop version for this code. For example, I want to display in a table the AIC/BIC/HQIC for a set of ARMA(p,q) models, where, say p=1,..,5 and q=1,..,6

        Comment


        • #5
          This replicates arimasoc for my variable (product)

          Code:
          capture program drop getarima
          program getarima
          global F %6.2f
          global G %5.0f
          
          di "Model" _col(15) "LL" _col(25) "df" _col(35) "AIC" _col(45) $F "BIC"
          forv ar = 0/2 {
              forv ma = 0/2 {
                  qui arima product , arima(`ar',0,`ma')
                  qui estat ic
                  di "ARMA(`ar',`ma')" $F _col(15) r(S)[1,3] _col(25) $G r(S)[1,4] _col(35) $F r(S)[1,5] _col(45) $F r(S)[1,6]
              }    
          }
          
          end
          
          getarima

          Comment


          • #6
            estat ic doesn't give you the HQIC, but here's the rest of what it does.

            Code:
            capture program drop getarima
            program getarima
            global F %6.2f 
            global G %5.0f
            
            di "Model" _col(15) "LL" _col(25) "df" _col(35) "AIC" _col(45) $F "BIC" _col(55) "AICc" _col(65) "CAIC"
            forv ar = 0/2 {
                forv ma = 0/2 {
                    qui arima product , arima(`ar',0,`ma')
                    qui estat ic , all
                    di "ARMA(`ar',`ma')" $F _col(15) r(S)[1,3] _col(25) $G r(S)[1,4] _col(35) $F r(S)[1,5] _col(45) $F r(S)[1,6] _col(55) $F r(S)[1,7] _col(65) $F r(S)[1,8]
                }    
            }
            
            end
            
            getarima

            Comment


            • #7
              Code:
              capture program drop getarima
              program getarima
              global F %6.2f 
              global G %5.0f
              
              di "Model" _col(15) "LL" _col(25) "df" _col(35) "AIC" _col(45) $F "BIC" _col(55) "AICc" _col(65) "CAIC"
              local aic = 99999999
              local bic = 99999999
              forv ar = 0/2 {
                  forv ma = 0/2 {
                      qui arima product , arima(`ar',0,`ma')
                      qui estat ic , all
                      di "ARMA(`ar',`ma')" $F _col(15) r(S)[1,3] _col(25) $G r(S)[1,4] _col(35) $F r(S)[1,5] _col(45) $F r(S)[1,6] _col(55) $F r(S)[1,7] _col(65) $F r(S)[1,8]
                      
                      if r(S)[1,5] < `aic' {
                          local bestar = `ar'
                          local bestma = `ma'
                          local aic = r(S)[1,5]
                      }    
                      if r(S)[1,6] < `bic' {
                          local bestar2 = `ar'
                          local bestma2 = `ma'
                          local bic = r(S)[1,6]
                      }    
                  }
              }
                  di "Smallest (AIC): ARMA(`bestar', `bestma')"
                  di "Smallest (BIC): ARMA(`bestar2', `bestma2')"
              end
              
              getarima

              Comment


              • #8
                gets the HQIC

                Code:
                capture program drop getarima
                program getarima
                global F %6.2f 
                global G %5.0f
                
                di "Model" _col(15) "LL" _col(25) "df" _col(35) "AIC" _col(45) $F "BIC" _col(55) "HQIC"
                local aic = 99999999
                local sbic = 99999999
                forv ar = 0/2 {
                    forv ma = 0/2 {
                        qui arima product , arima(`ar',0,`ma')
                        local df = e(rank)
                        local ll = e(ll)
                        local N = e(N)
                        local aic = 2*`df' - 2*`ll'
                        local bic = ln(`N')*(`df') - 2*`ll'
                        local hqic = 2*ln(ln(`N'))*(`df') - 2*`ll'
                        di "ARMA(`ar',`ma')" $F _col(15) `ll' _col(25) $G `df' _col(35) $F `aic' _col(45) $F `bic' _col(55) $F `hqic'
                    }
                }
                end
                
                getarima

                Comment


                • #9
                  Thank you so much!. It worked!
                  Last edited by John Andrews; 23 Aug 2023, 03:36.

                  Comment


                  • #10
                    you can drop those two locals (aic =999999) at the front of the last one.

                    Comment

                    Working...
                    X