Announcement

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

  • Calculating the AIC and BIC of ARDL(p,q) models for different values of p and q

    Dear all!
    I hope you are well.

    I am trying to calculate the AIC and BIC of ARDL(p,q) models for different values of p and q.

    In particular, If p_max=q_max=4 I want to calculate the AIC and BIC for the following set of models

    ARDL(0,0) ARDL(0,1), ARDL(0,2), ARDL(0,3), ARDL(0,4)

    ARDL(1,0), ARDL(1,1), ARDL(1,2), ARDL(1,3), ARDL(1,4)

    ARDL(2,0), ARDL(2,1), ARDL(2,2), ARDL(2,3), ARDL(2,4)

    ARDL(3,0), ARDL(3,1), ARDL(3,2), ARDL(3,3), ARDL(3,4)

    ARDL(4,0), ARDL(4,1), ARDL(4,2), ARDL(4,3), ARDL(4,4)

    So I am using the Stata command

    ardl y x, aic maxlags(4) matcrit(lagcombs)
    matrix list lagcombs

    but the problem is that this command considers this set of models

    ARDL(1,0), ARDL(1,1), ARDL(1,2), ARDL(1,3), ARDL(1,4)

    ARDL(2,0), ARDL(2,1), ARDL(2,2), ARDL(2,3), ARDL(2,4)

    ARDL(3,0), ARDL(3,1), ARDL(3,2), ARDL(3,3), ARDL(3,4)

    ARDL(4,0), ARDL(4,1), ARDL(4,2), ARDL(4,3), ARDL(4,4)

    Is there any way to calculate the AIC and BIC for


    ARDL(0,0) ARDL(0,1), ARDL(0,2), ARDL(0,3), ARDL(0,4)

    Also, is there any way to obtain in a table BOTH the AIC and BIC because the above command does not allow to have something like

    ardl y x, aic bic maxlags(4) matcrit(lagcombs)

    Thank you all!

  • #2
    You need to do a few extra steps by hand.

    Code:
    ardl y x, aic maxlags(4) matcrit(aiclags)
    ardl y x, bic maxlags(4) matcrit(biclags)
    matrix lagcombs = (aiclags, biclags[., "bic"])
    local colnames : colnames lagcombs
    generate byte touse = e(sample)
    forvalues l = 4(-1)0 {
        regress y L(0/`l').x if touse
        estat ic
        matrix lagcombs = (0, `l', r(S)[1, "AIC"], r(S)[1, "BIC"] \ lagcombs)
    }
    matrix colnames lagcombs = `colnames'
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Dear Sebastian,

      Thank you so much for this.


      You are amazing!

      Comment

      Working...
      X