IRF from the univariate model

Questions and discussions on Time Series Analysis
lnw
Posts: 18
Joined: Fri Sep 10, 2010 3:21 pm

IRF from the univariate model

Unread post by lnw »

Hi,

I am trying to obtain the impulse response with confidence bands for the univariate autoregression.

My model is a simplified model from Cerra and Saxena(AER 2008)
y_t=alpha*y_t-1 + beta_0*dummy_t +beta_1*dummy_t-1 + error_t

I would like to get the impulse response of dummy variable( dummy takes 0 or 1) to y_t.

Since the command of IMPULSE and the procedure @VARIRF work only for VAR, I artificially made the bivariate system.
Furthermore, I calculated the IRFs of error_t and converted them to the IRFs of dummy.

Code: Select all

system(model=bivar)
variables y x
lags 1
end(system)

estimate(noprint,resid=resids)
declare rect[real] beta
compute beta =||alpha,0.0|0.0,0.0||
compute %modelsetcoeffs(bivar,beta)
*Set variance-covariance matrix
compute f=%identity(2)

*Calculate IRFs for error term e_t
impulse(model=bivar,steps=nsteps,factor=f,results=baseirfs,noprint)

*calculate IRFs for dummy from IRFs for error
set IRFD1 = beta_0*baseirfs(1,1)+beta_1*baseirfs(1,1){1}
Can the above way be problematic?
Is there any better way to calculate the IRF of dummy in a univariate model?
Also, how can I calculate the confidence bands using bootstrapping in my case?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: IRF from the univariate model

Unread post by TomDoan »

That seems somewhat unnatural. Just estimate the equation, and combine it with an "empty" equation with DUMMY as the dependent variable:

Code: Select all

linreg(define=yeqn) y
# y{1} dummy{0 1}
equation(empty) dummyeqn dummy 
model bimodel yeqn dummyeqn
impulse(model=bimodel,shocks=||0.0,1.0||,results=responses,steps=nsteps)
You can then bootstrap that fairly easily, since you're just altering the YEQN.
lnw
Posts: 18
Joined: Fri Sep 10, 2010 3:21 pm

Re: IRF from the univariate model

Unread post by lnw »

Thank you so much, Tom.

I successfully got the IRF thanks to your advice.
To get the confidence bands for the IRF using Bootstrapping, I am trying to use a baseline of ymmodel in simszhaecm1999.

Code: Select all

*Combine two equations and calculate IRF for dummy
group bimodel yeqn dummyeqn
impulse(noprint,model=bimodel, shocks=||0.0,1.0||, results=baseirfs,steps=nsteps)

*Set up for Bootstrapping to obtain confidence bands for IRFs
compute nvar=%modelsize(bimodel)
declare vect[series] udraws(nvar) resample(nvar)
compute rstart=%regstart(),rend=%regend() 

*Set up the parallel system for the resampled data
do i=1,nvar
set resample(i) = %modeldepvars(bimodel)(i){0}
end do i
equation yeqn1 resample(1)
# resample(1){1} resample(2){0 to 4}

equation(empty) dummyeqn1 resample(2)

group bootmodel yeqn1 dummyeqn1
system(model=bootmodel)
end(system)

declare vect[rect] %%responses
dim %%responses(bootdraws)
declare rect[series] impulses(nvar,nvar)
declare vect ix

infobox(action=define,progress,lower=1,upper=bootdraws) "Bootstrap Simulation"
do draw=1,bootdraws
*Draw a bootstrapped sample
boot entries rstart rend
do i=1,nvar
set udraws(i) rstart rend = resids(i)(entries(t))
end do i

forecast(paths,model=bimodel,from=rstart,to=rend,results=resample)
# udraws

*Estimate the model with resampled data
estimate(noprint,noftest,cvout=v)
impulse(noprint,model=bootmodel,cv=v,results=impulses,steps=nsteps)

*Store the impulse responses
dim %%responses(draw)(nvar*nvar,nsteps)
ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
infobox(current=draw)

end do draw
infobox(action=remove)

@mcgraphirf(model=bimodel,center=input,impulses=baseirfs,percent=||.01,.16,.84,.99||,footer="Figure. 68% and 98% other-percentile bootstrap bands")
However, I just get an error of occurrence of loop/block.
I am guessing that the specification of parallel system is a problem.
I would really appreciate if you specify and correct any problem in my codes or suggest any other method.

Thank you
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: IRF from the univariate model

Unread post by TomDoan »

That's not the way to go since the only point of the equation for DUMMY is to allow you to shock the exogenous variable. The simplest way to do bootstrapping with a single equation model is to use UFORECAST with the BOOT option. This will do what you want: define a base equation that's used to generate the bootstrapped series, and the working equation with the same form, but with Y replaced with the bootstrapped version (called YBOOT). You just have to re-estimate for each draw, do the IMPULSE instruction and save the results for later processing.

Code: Select all

linreg(define=baseeqn) y
# y{1} dummy{0 1}
*
modify baseeqn yeqn
vreplace y with yboot
set yboot = y
equation(empty) dummyeqn dummy 
group bimodel yeqn dummyeqn
*
compute ndraws=10000
compute nsteps=20
*
declare vect[rect] %%responses
*
dim %%responses(ndraws)
do draw=1,ndraws
   uforecast(boot,equation=baseeqn) yboot
   linreg(equation=yeqn,noprint)
   impulse(model=bimodel,shocks=||0.0,1.0||,results=impulses,steps=nsteps,noprint)
   dim %%responses(draw)(2,nsteps)
   ewise %%responses(draw)(i,j)=ix=%vec(%xt(impulses,j)),ix(i)
end do draws
*
@mcgraphirf(model=bimodel,shocklabels=||"To Dummy"||,varlabels=||"Y"||,include=||1||)
Gary
Posts: 12
Joined: Wed Aug 12, 2009 11:22 am

Re: IRF from the univariate model

Unread post by Gary »

Hi Tom,

I have a question that is somewhat related to the above. I have constructed an ARDL model, examining pass-through from the central bank policy interest rate to market rates. What I now want to do is to use the coefficients to simulate say, the dynamic effect of a reduction in the central bank policy rate on commercial lending rates going forward. Is there an efficient way of doing this? I was looking for an example, but have been unsuccessful thus far.

Best regards

Gary.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: IRF from the univariate model

Unread post by TomDoan »

Gary wrote:Hi Tom,

I have a question that is somewhat related to the above. I have constructed an ARDL model, examining pass-through from the central bank policy interest rate to market rates. What I now want to do is to use the coefficients to simulate say, the dynamic effect of a reduction in the central bank policy rate on commercial lending rates going forward. Is there an efficient way of doing this? I was looking for an example, but have been unsuccessful thus far.

Best regards

Gary.
It would be exactly like what is done above. You would just have the exogenous variable instead of the "dummy".
Gary
Posts: 12
Joined: Wed Aug 12, 2009 11:22 am

Re: IRF from the univariate model

Unread post by Gary »

Many thanks Tom, it works quite well. The shape of the IRF is similar to the graph of the lag distribution that one gets when doing the polynomial division (β(L)/α(L), where β(L) and α(L) are, respectively, the distributed lag and autoregressive polynomials. The advantage of the IRF is that one now gets confidence bands.

Best wishes,

Gary.
mpalmero
Posts: 27
Joined: Fri Dec 26, 2008 9:34 pm

Re: IRF from the univariate model

Unread post by mpalmero »

Dear Tom
I ran and ARMA(6,1) model and I was able to get the IRF using the impulse command. Could you please help me telling me how I can compute the IRF confidence bands? And also how to get a accumulated IRF plus their confidence bands for the same model? Many thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: IRF from the univariate model

Unread post by TomDoan »

mpalmero wrote:Dear Tom
I ran and ARMA(6,1) model and I was able to get the IRF using the impulse command. Could you please help me telling me how I can compute the IRF confidence bands? And also how to get a accumulated IRF plus their confidence bands for the same model? Many thanks
The coefficients from an ARMA model (or even an AR model estimated by maximum likelihood) doesn't have a well-known posterior distribution. Instead, you have to do some form of MCMC. BOXJENK has a METHOD=EVAL option that allows you to get the likelihood for an input set of coefficients. I suspect that using a proposal density of the standard covariance from the point estimates for BOXJENK will work relatively well.
Post Reply