Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Are you asking why you get different results from different runs of Monte Carlo methods?
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
When I run the same program file at different times, I obtain different estimation results. Please, see the two estimation output below. "Draw XXXX Executing swap" and the coefficients/standard errors are not same.
First estimation:
VAR Lag Selection
Lags HQ
0 8537.45885
1 3006.96508
2 2936.57847
3 2917.36004*
4 2934.04264
5 2949.18039
6 2939.61054
Draw -2000 Executing swap
BETASYS(1)(1,1) 16.337 7.996
BETASYS(1)(2,1) 1.303 0.086
BETASYS(1)(3,1) -0.121 0.146
BETASYS(1)(4,1) -0.229 0.086
BETASYS(1)(5,1) -0.072 0.323
BETASYS(1)(6,1) -0.319 0.480
BETASYS(1)(7,1) 0.409 0.324
BETASYS(1)(8,1) 0.030 0.039
BETASYS(1)(9,1) -0.013 0.054
Second Estimation:
VAR Lag Selection
Lags HQ
0 8537.45885
1 3006.96508
2 2936.57847
3 2917.36004*
4 2934.04264
5 2949.18039
6 2939.61054
Draw -1996 Executing swap
Draw -1995 Executing swap
Draw -1985 Executing swap
BETASYS(1)(1,1) 16.208 8.065
BETASYS(1)(2,1) 1.303 0.087
BETASYS(1)(3,1) -0.122 0.144
BETASYS(1)(4,1) -0.228 0.084
BETASYS(1)(5,1) -0.075 0.322
BETASYS(1)(6,1) -0.317 0.481
BETASYS(1)(7,1) 0.410 0.325
BETASYS(1)(8,1) 0.031 0.038
BETASYS(1)(9,1) -0.014 0.053
First estimation:
VAR Lag Selection
Lags HQ
0 8537.45885
1 3006.96508
2 2936.57847
3 2917.36004*
4 2934.04264
5 2949.18039
6 2939.61054
Draw -2000 Executing swap
BETASYS(1)(1,1) 16.337 7.996
BETASYS(1)(2,1) 1.303 0.086
BETASYS(1)(3,1) -0.121 0.146
BETASYS(1)(4,1) -0.229 0.086
BETASYS(1)(5,1) -0.072 0.323
BETASYS(1)(6,1) -0.319 0.480
BETASYS(1)(7,1) 0.409 0.324
BETASYS(1)(8,1) 0.030 0.039
BETASYS(1)(9,1) -0.013 0.054
Second Estimation:
VAR Lag Selection
Lags HQ
0 8537.45885
1 3006.96508
2 2936.57847
3 2917.36004*
4 2934.04264
5 2949.18039
6 2939.61054
Draw -1996 Executing swap
Draw -1995 Executing swap
Draw -1985 Executing swap
BETASYS(1)(1,1) 16.208 8.065
BETASYS(1)(2,1) 1.303 0.087
BETASYS(1)(3,1) -0.122 0.144
BETASYS(1)(4,1) -0.228 0.084
BETASYS(1)(5,1) -0.075 0.322
BETASYS(1)(6,1) -0.317 0.481
BETASYS(1)(7,1) 0.410 0.325
BETASYS(1)(8,1) 0.031 0.038
BETASYS(1)(9,1) -0.014 0.053
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Yes. This does Markov Chain Monte Carlo. That's a simulation technique.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
I am using the following to obtain impulse responses from a regime-switching VAR with two endogenous variables:
Is it possible to dictate the value of a shock and for this to be the same across regimes by computing the appropriate factor? Thank you.
Code: Select all
*
* Save IRF's for regime 1
*
@MSSysRegSetModel(regime=1)
impulse(noprint,model=MSSysRegModel,results=impulses1,steps=nsteps)
*
* Save IRF's for regime 2
*
@MSSysRegSetModel(regime=2)
impulse(noprint,model=MSSysRegModel,results=impulses2,steps=nsteps)Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
The Balcilar-Gupta-Miller replication is similar to this but controls the shock sizes. (In EEV, the whole point is to allow for the differing shock sizes).
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
With I(1) series for which the hypothesis of no cointegration is rejected, I use the program for Balcilar et al (2015), which, as you say, controls the shock sizes. With series of different orders of integration -or with I(1) series which aren't cointegrated- I use the program for Ehrmann et al (2003).
The point is to check the effects of same-size shocks across regimes -and compare them with the effects from a non-switching VAR. For example like in this graph:

To do the MS-VAR responses to same-size shocks (across regimes) of 1.51 and 3.4 as in the graph, I altered the main diagonal of the FACTOR array:
Does this look OK?
The point is to check the effects of same-size shocks across regimes -and compare them with the effects from a non-switching VAR. For example like in this graph:
To do the MS-VAR responses to same-size shocks (across regimes) of 1.51 and 3.4 as in the graph, I altered the main diagonal of the FACTOR array:
Code: Select all
*
* Save IRF's for regime 1
*
@MSSysRegSetModel(regime=1)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor))),factor(1,1)=1.51,factor(2,2)=3.4
impulse(noprint,model=MSSysRegModel,results=impulses1,steps=nsteps,factor=factor)
*
* Save IRF's for regime 2
*
@MSSysRegSetModel(regime=2)
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor))),factor(1,1)=1.51,factor(2,2)=3.4
impulse(noprint,model=MSSysRegModel,results=impulses2,steps=nsteps,factor=factor)Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Thanks Tom. Then, is it a problem to have different "Draw -XXXX Executing swap" in each case?
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
No. That's just a few of them at the start of the burn-in.atarca wrote:Thanks Tom. Then, is it a problem to have different "Draw -XXXX Executing swap" in each case?
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Answering my own question here: No.alexecon wrote: Does this look OK?
Code: Select all
compute factor=%decomp(sigmav(2)),factor=factor*inv(%diag(%xdiag(factor)))For a variance-covariance matrix obtained from an MS-VAR in regime 1, the following confirms:
Code: Select all
dis "Omega=" sigmav(1)
*
dis "[11.4.21]"
*
compute P=%decomp(sigmav(1))
dis "P=" P
compute transP=tr(P)
dis "Transpose P=" transP
declare symm Omega(2,2)
compute Omega=P*transP
dis "Omega = P x Transpose P =" Omega
*
dis "[11.4.9]"
*
compute D12=%diag(%xdiag(P))
dis "D12=" D12
compute A=P*inv(D12)
dis "A=" A
compute ADtrA=A*D12^2*tr(A)
dis "Omega = A x D x Transpose A =" ADtrARe: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
I'm not really sure what you're trying to do. If you want to compare the IRF's from the regime switching with those from a fixed regime model, why wouldn't you just use a common "factor" matrix for all the IRF's?
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
If by "common" you mean the same factor, then yes, that's what I ended up doing. It just took me a while to find out how to standardise the shocks in the fixed VAR with this
By the way, just to confirm, the percentiles give the 95% confidence bands, is that right?
Can I also just say how much I enjoy using RATS. I think Hamilton, Enders and RATS is all one needs to understand and do time series. Thank you also for the online support.
Code: Select all
function testing sigma model
type rect testing
type symm sigma
type model model
compute testing=%decomp(sigma),testing=testing*inv(%diag(%xdiag(testing)))
end
@MCVARDoDraws(draws=10000,model=model,steps=nsteps,ffunction=testing)
@MCProcessIRF(model=model,lower=lower,upper=upper,irf=irf,percentiles=||.025,.975||)Can I also just say how much I enjoy using RATS. I think Hamilton, Enders and RATS is all one needs to understand and do time series. Thank you also for the online support.
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
Dear Tom,
I am so sorry to bother you again. Because the referee ask me to resubmit our paper in this month. I have no time to learn RATS carefully. Please forgive me. I have following question:
1. I would like to adopt MS(1)-VAR(1) to two endogenous variables. I could not know how to modify the command of 'spgraph'. I make a mark using red characters.
2. My data is irregularly daily data. How could I modify the code?
I attach the modified code and my data. Thanks very much for many helps!
I am so sorry to bother you again. Because the referee ask me to resubmit our paper in this month. I have no time to learn RATS carefully. Please forgive me. I have following question:
1. I would like to adopt MS(1)-VAR(1) to two endogenous variables. I could not know how to modify the command of 'spgraph'. I make a mark using red characters.
2. My data is irregularly daily data. How could I modify the code?
I attach the modified code and my data. Thanks very much for many helps!
- Attachments
-
- MSVAR IRF code.docx
- Modified code
- (17.98 KiB) Downloaded 862 times
-
- Canada.xlsx
- data
- (161.44 KiB) Downloaded 821 times
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
There's a huge difference between EEV and what you're doing. EEV have monthly data, run everything in logs and two of the three series are macroeconomic series. You have daily data, you're using log changes, and although I don't know what LSP is, it's clearly a series with much less serial correlation in differences than quarterly macro data has in logs. There are two major effects from the differences between these:
1. The "high" and "low" oil variance regimes are much less well-defined with your model. EEV has basically one sample split in 1986 with a couple of short-term market lulls before that. With your data, the daily variance is all over the place. Daily data will have volatility clustering (i.e. GARCH-like effects) which disappear when you go to monthly data.
2. When modeled in differences, the 100 step IRF's will be impact, maybe one period after that, and then effectively straight zeros from that point on.
1. The "high" and "low" oil variance regimes are much less well-defined with your model. EEV has basically one sample split in 1986 with a couple of short-term market lulls before that. With your data, the daily variance is all over the place. Daily data will have volatility clustering (i.e. GARCH-like effects) which disappear when you go to monthly data.
2. When modeled in differences, the 100 step IRF's will be impact, maybe one period after that, and then effectively straight zeros from that point on.
Regime-dependent IRF plotting and Generalized IRF + FEVD
Dear moderator,
I would like to plot regime-dependent IRF with the MCProcessirf procedure. I use the Ehrmann et al. (2003) replication code. Furthermore, is it possible to use a rats existing code to implement generalized IRF and FEVD (rather than orthogonalization) IN the code of Ehrmann et al. (2003)?
My code is as follows:
I dont know why i get an error message. I read many topics dealing with it but i don't find the response.
Thank you very much,
Regards
I would like to plot regime-dependent IRF with the MCProcessirf procedure. I use the Ehrmann et al. (2003) replication code. Furthermore, is it possible to use a rats existing code to implement generalized IRF and FEVD (rather than orthogonalization) IN the code of Ehrmann et al. (2003)?
My code is as follows:
Code: Select all
*************************************************************************
******************* MS-VAR procedure - EM estimation*********************
*************************************************************************
******************* Initialization
open data data_v5.xlsx
calendar(m) 2000:2
allocate 2015:4
data(format=xlsx,org=col) 2000:2 2015:4
@varlagselect(Lags=6,crit=hq)
# us euro china
comp varlag = 1
******************* Estimation procedure
@mssysregression(states=2,switch=ch)
# us euro china g
# constant us{1 to varlag} euro{1 to varlag} china{1 to varlag}
nonlin(parmset=regparms) betasys sigmav
nonlin(parmset=msparms) p
gset pt_t = %zeros(nstates,1)
gset pt_t1 = %zeros(nstates,1)
gset psmooth = %zeros(nstates,1)
compute gstart=2000:2,gend=2015:4
@MSSysRegInitial gstart gend
frml logl = f=%MSSysRegFVec(t),pt_t1=%mcstate(p,pstar),$
pt_t=pstar=%msupdate(f,pt_t1,fpt),log(fpt)
maximize(start=(pstar=%MSSysRegInit()),parmset=regparms+msparms,$
method=bfgs,iters=500,pmethod=simplex,piters=5) logl gstart gend
****************** Graphical analysis
@%mssmooth p pt_t pt_t1 psmooth
set p1smooth = psmooth(t)(1)
set shade = p1smooth>=0.5
spgraph(header="Angola", vfields=3,hfields=2)
graph(footer="Smoothed Probability of Regime 1",max=1.0,min=0.0,shading=shade)
# p1smooth
graph(footer="USD_CHF",shading=shade)
# us
graph(footer="EUR_CHF",shading=shade)
# euro
graph(footer="RMB_CHF",shading=shade)
# china
spgraph(done)
****************** Save IRF's for regime 1
@MSSysRegSetModel(regime=1)
*compute factor=%decomp(sigmav(1)),factor=factor*inv(%diag(%xdiag(factor)))
*impulse(print,model=MSSysRegModel,results=impulses1,steps=10,factor=factor)
compute factor=%decomp(sigmav(1))
errors(print,model=MSSysRegModel,results=errors1,steps=10,factor=factor)
****************** Save IRF's for regime 2
@MSSysRegSetModel(regime=2)
*compute factor=%decomp(sigma),factor=factor*inv(%diag(%xdiag(factor)))
*impulse(print,model=MSSysRegModel,results=impulses2,steps=10,factor=factor)
compute factor=%decomp(sigmav(2))
errors(print,model=MSSysRegModel,results=errors2,steps=10,factor=factor)
******************* Graph IRF
@MCProcessIRF(model=MSSysRegModel,lower=lower,upper=upper,irf=irf)
spgraph(footer="",vfields=3,hfields=2,$
xlabels=||"Regime 1","Regime 2"||,ylabels=||"Cap Util","CPI","Oil Price"||)
do var=1,3
table(noprint) / lower(var,5) upper(var,5) lower(var,6) upper(var,6)
do shock=5,6
graph(row=var,col=shock-4,max=%maximum,min=%minimum,nodates) 3
# irf(var,shock)
# lower(var,shock) / 2
# upper(var,shock) / 2
end do shock
end do var
spgraph(done)
Thank you very much,
Regards
Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's
What's "G"? You have that included as a dependent variable, but it doesn't seem to be included anywhere else in the model.
The "generalized" FEVD is a junk statistic---it's the decomposition of a number with no economic meaning.
The "generalized" FEVD is a junk statistic---it's the decomposition of a number with no economic meaning.