Announcement

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

  • Stata saying my unobserved variable of DSGE model is invalid.

    I am trying to write a DSGE model to run on my data.
    Click image for larger version

Name:	WhatsApp Image 2024-04-15 at 17.45.15_ad7a66bf.jpg
Views:	1
Size:	38.0 KB
ID:	1750042


    in the following code: p = pi_t, y = y and r = i_t

    (For example, I am using usmacro2 data . The issue that I am facing is that the model is not running even though I have clearly defined that 'a' is an unobserved variable like 'v' . but I keep getting invalid 'a' as the result of running it from my do-file editor. (To be clear a is supposed to be the tech. Shock and v is supposed to be the monetary shock))
    (Block of code I am working with)
    Code:
    clear
    webuse usmacro2
    constraint 1 _b[beta]=0.96
    dsge (p = {beta}*E(F.p) + {kappa}*y) /// 1. Phillips curve
            (y = F.y - (1/{sigma})*(r - E(F.p) - ((1/{beta} - 1) + {psi}*{phi_y}*(E(f.a) - a))), unobserved) /// 2. DIS
            (r = {rho} + {phi_pi}*p + {phi_y}*y + v) /// 3. Interest Rate Rule (F.v = {rho_v}*v, state) /// 4. Monetary Shock
            (F.a = {rho_a}*a, state), from(y=0, p=0, a=0, v=0, r={rho}, psi = 1.5) constraint(1) /// 5. Tech shock
    (Where I am facing this issue ^)

    Example of a code that does work:
    Code:
    clear
    webuse usmacro2
    constraint 1 _b[beta]=0.96
    dsge (p = {beta}*E(F.p) + {kappa}*y) /// 1. Phillips curve
    (y = F.y - (1/{sigma})*(r - E(F.p) - ((1/{beta} - 1) + {psi}*{phi_y}*(E(f.a) - a))), unobserved) /// 2. DIS
    (r = {rho} + {phi_pi}*p + {phi_y}*y + v) /// 3. Interest Rate Rule (F.v = {rho_v}*v, state) /// 4. Monetary Shock
    (F.a = {rho_a}*a, state), from(y=0, p=0, a=0, v=0, r={rho}, psi = 1.5) constraint(1) /// 5. Tech shock
    Last edited by Simran Pal Singh; 15 Apr 2024, 14:07. Reason: forgot to add tags
Working...
X