Announcement

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

  • Standard Error estimation in aidsills_elas.ado (SJ-15-2 st0393)

    Hoping someone can help me understand the process by which aidsills_elas.ado (from Lecocq, Robin SJ-15-2 st0393) computes standard errors for elasticity estimates. The routine does not seem to follow a standard bootstrap approach. The documentation contains a reference to Blundell Robin (Applied Econometrics, 1999) on how aidsills computes standard errors for the aids model parameters but does not discuss the approach to the standard errors for the elasticity calculations. The mata function aidsills_elas from aidsills_elas.ado is copied below.

    b0 = vec(b)
    ab0 = abs(b0)
    if (colsum(b0) != 0) {
    dab0 = b0:/ab0
    }
    else {
    dab0 = 1
    }
    e = (1e-8)*rowmax((ab0, (1e-2)*J(rows(b0),1,1))):*dab0
    be = b0+e
    e = be-b0
    k = 1
    i = 1
    while (i <= cols(b)) {
    j = 1
    while (j <= rows(b)) {
    be = b
    be[j,i] = b[j,i]-e[k]

    alpha = intcpt'*be[|n+nx+nv+1,1\nvar,n|]
    gama = be[|1,1\n,n|]
    beta = be[|n+1,1\n+1,n|]

    _alpha0 = a_0
    a_p = _alpha0 + alpha*prices + .5*prices'*gama*prices
    lx = totexp-a_p
    w = alpha' + gama'*prices + beta':*lx

    if (nx > 1) {
    b_p = exp(beta*prices)
    lambda = be[|n+2,1\n+2,n|]
    lx2 = (lx^2)/b_p
    w = w + lambda':*lx2
    }

    dw_dx = beta'
    if (nx > 1) {
    dw_dx = dw_dx + 2*(lambda':*lx)/b_p
    }
    er = 1 :+ (dw_dx:/w)
    ep = gama' - dw_dx#(alpha + .5*prices'*(gama+gama'))
    if (nx > 1) {
    ep = ep - lambda'#((2*(alpha + .5*prices'*(gama+gama'))):*lx/b_p+lx2:*beta)
    }
    ep = -I(n) + ep:/w
    epc = ep + er#w'
    te = w\er\diagonal(ep)\diagonal(epc)\vec(ep)\vec(epc)

    dtk = (te-t):/e[k]
    if (k == 1) {
    dt = dtk
    vt = v[1,1]#(dtk:^2)
    }
    else {
    vt = vt + 2*dtk:*(dt*v[|1,k\k-1,k|]) + v[k,k]#(dtk:^2)
    dt = dt,dtk
    }
    j = j+1
    k = k+1
    }
    i = i+1
    }

  • #2
    It's not bootstrapping, it's just the delta method applied to the elasticities as functions of the coefficients. You can still get the standard errors of the coefficients by bootstrapping, and the delta method here would take the bootstrap estimate of the variance - covariance matrix of the coefficients as given, and calculate the standard errors of the elasticities based on that.

    Alternatively you could bootstrap the elasticities directly.
    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

    Comment


    • #3
      It happens to me quite often that the -aidsills_elas- command does not produce any standard errors for some of the elasticities (instead, a dot appears in the bracket). Sometimes, setting a different value for alpha_0 resolves the issue, but not always. Has anyone got this problem too? Any ideas why is this happening and what is the meaning of it? Any suggestions how to deal with it?
      Thanks!

      Comment


      • #4
        In my case, the above problem occurs especially if the homogeneity and symmetry constrained model is fitted, but tends not to occur for the unconstrained model..

        Comment

        Working...
        X