Shock to exogenous variable

Questions and discussions on Time Series Analysis
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Shock to exogenous variable

Unread post 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?
Attachments
equation.GIF
equation.GIF (2.05 KiB) Viewed 6945 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Shock to exogenous variable

Unread post 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.
cczzwhy
Posts: 48
Joined: Tue Jun 16, 2015 3:47 am

Re: Shock to exogenous variable

Unread post 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...
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Shock to exogenous variable

Unread post 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
Post Reply