Hi there,
I'm estimating a smooth transition model in the first step and I want to obtain a Generalized Impulse Reponse function afterwards. I have attached the code below.
The codes ie generally working but there is one problem: BD is my left hand side variable and the current version shocks BD. However, my aim is to analyze how a shock to one the regressors, mmod, affects BD. However, I'm not sure how to modify the second part of the code in order to tackles this issue. Any help is highly appreciated.
Thanks
Gibril
compute gstart = 2003:01
compute gend = 2011:09
set CI = 0,617*mm0-bro1_NED+2,8+1,678*I1t-0,371*I1t*mm0
set mm0d = mm0-mm0(t-1)
set a = mm0d
statistics a
*statistics CI
set b = bro1_NED
set bd = bro1_NED-bro1_NED(t-1)
set mmod = mm0-mm0(t-1)
compute scalef=1.0/sqrt(%variance)
nonlin(parmset=P) mu0 mu1 alpha1 alpha2 alpha3 alpha4 alpha5 alpha6 gamma1
frml transfct2 = (1+exp(-scalef*gamma1*(mm0d(t-1))))^-1
frml strgl1 bd = mu0+alpha1*(a)+alpha3*bd(t-1)+alpha5*CI(t-1)+transfct2(T)*(mu1+alpha2*(a)+alpha4*bd(t-1)+alpha6*CI(T-1))
compute gamma1=1.46, mu0=0,mu1=0,alpha1=1, alpha2=alpha3=alpha4=alpha5=alpha6=1
nlsystem(parmset=P,iters=900,subiters=3000,robust,lwindow=neweywest,residuals=Vector1,dervives=vector2,cvout=aa,lags=24) gstart gend strgl1
group(CV=%sigma~\aa) estr strgl1>>bd
statistics mm0
clear girf
clear girf
compute stddev=0.026281 *sqrt(%seesq)
set girf 2005:05 2005:05+80 = 0.0
compute ndraws=1000
do draw=1,ndraws
set shocks = %ran(stddev)
Forecast(paths,model=estr,from=2005:05,steps=80,results=basesims)
# shocks
compute ishock=500*0.0064
compute shocks(2005:05)=shocks(2005:05)+ishock
Forecast(paths,model=estr,from=2005:05,steps=80,results=sims)
# shocks
set girf 2005:05 2005:05+80 = girf+(sims(1)-basesims(1))/ishock
end do draw
set girf 2005:05 2005:05+80 = girf/ndraws
graph1
# girf
graph2
# bd
GIRF
Questions and discussions on Time Series Analysis
Return to “Other Time Series Analysis”
Jump to
- News and Announcements
- ↳ Forum Announcements
- ↳ RATS Product Announcements
- ↳ Newsletters
- Courses and Seminars
- ↳ Course Announcements
- ↳ ARCH GARCH and Volatility
- ↳ RATS Programming Manual
- Procedures, Examples, and Sample Code
- ↳ RATS Procedures
- ↳ Examples and Sample Code
- ↳ Looking for Code?
- General RATS Discussions
- ↳ Data: Reading, Writing, Transforming
- ↳ Graphics, Reports, and Other Output
- ↳ Help With Programming
- ↳ Other RATS Usage Questions
- ↳ RATS for Teachers & Students
- ↳ Tips and Tricks
- ↳ Suggestion Box
- Econometrics Issues
- ↳ VARs (Vector Autoregression Models)
- ↳ ARCH and GARCH Models
- ↳ State Space Models/DSGE
- ↳ Structural Breaks and Switching Models
- ↳ Panel Data
- ↳ Other Time Series Analysis
- ↳ General Econometrics
- CATS (Cointegration Analysis)
- ↳ CATS News and Announcements
- ↳ CATS Questions