Page 1 of 1

Shock to exogenous variable

Posted: Thu May 26, 2016 7:31 am
by cczzwhy
Hello,Tom!I got a question about impulse response of linear regression.The regression equation is attached,What should i do to construct the IRF of variable Yt to shock of variable Zt,like considering the impulse of output to oil price shock...should I use impulse option or forecast?

Shock to exogenous variable

Posted: Thu May 26, 2016 8:53 am
by TomDoan
As you have that written (is the t+h a typo?) that's an ARDL model which can be handled as described in Chapter 2 of the User's Guide.

In order to use IMPULSE on this, you have to "endogenize" the Z variable by creating an empty equation with Z as the dependent variable. See, for instance, MONTEEXOGVAR.RPF.

Re: Shock to exogenous variable

Posted: Mon May 30, 2016 5:16 am
by cczzwhy
Thank you for your help,the typo t+h is becuase I want to calulate sth like

Code: Select all

linreg(lags=30,lwindow=newey) LIND
# constant LIND{1} LIND{2} SHOCK{1}
linreg(lags=30,lwindow=newey) LIND
# constant LIND{2} LIND{3} SHOCK{2}
linreg(lags=30,lwindow=newey) LIND
# constant LIND{3} LIND{4} SHOCK{3}
linreg(lags=30,lwindow=newey) LIND
# constant LIND{4} LIND{5} SHOCK{4}
linreg(lags=30,lwindow=newey) LIND
# constant LIND{5} LIND{6} SHOCK{5}
,how can i write them into a loop?I wanna get the coefficents of the shock variable and stderrs in series...

Re: Shock to exogenous variable

Posted: Tue May 31, 2016 10:30 am
by TomDoan

Code: Select all

clear(zeros) betas stderrs
do lag=1,5
   linreg(lags=30,lwindow=newey) LIND
   # constant LIND{lag lag+1} SHOCK{lag}
   compute betas(lag)=%beta(4)
   compute stderrs(lag)=%stderrs(4)
end do lag