Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Use this forum for posting example programs or short bits of sample code.
falcon223
Posts: 6
Joined: Wed Jun 10, 2015 4:48 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by falcon223 »

Dear Tom,

is there any way this can be done .

Thanks again.

Best regards
Rosen
falcon223
Posts: 6
Joined: Wed Jun 10, 2015 4:48 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by falcon223 »

Dear Tom,

Is it ok if I do my counterfactual simulation the following way;

@MSSysRegSetModel(regime=1)
compute mixmask=||1.0,0.0,0.0,1||
compute mixonly=factor*%diag(mixmask)*inv(factor)
dec vect[series] mixshocks(4)
do t=gstart,gend
compute %pt(mixshocks,t,mixonly*%xt(vresids,t))
end do t
*
forecast(paths,from=gstart,to=gend,model=MSSysRegModel,results=withshocks)
# mixshocks
set mix1 = withshocks(1)
set gap = mix-mix1



@MSSysRegSetModel(regime=2)
compute mixmask1=||1.0,0.0,0.0,1||
compute mixonly1=factor*%diag(mixmask1)*inv(factor)
dec vect[series] mixshocks(4)
do t=gstart,gend
compute %pt(mixshocks,t,mixonly*%xt(vresids,t))
end do t
forecast(paths,from=gstart,to=gend,model=MSSysRegModel,results=withshocks)
# mixshocks
set mix2 = withshocks(1)
set gap2 = mix-mix2

Now I get two series Mix1 (for regime1) and Mix 2 for (regime 2) . A
As I know the turning points from the VAR , I was thinking i can construct the series by using 'mix1' for regime1 dates and 'mix2' for regime 2 periods.
Do you think this will be okay.

Thanks again
Rosen
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

falcon223 wrote:Dear Tom,

is there any way this can be done .

Thanks again.

Best regards
Rosen
Probably not. Some things don't translate from fixed models to MS models.
falcon223
Posts: 6
Joined: Wed Jun 10, 2015 4:48 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by falcon223 »

Dear Tom,

I am trying to run the run a 3 variable model. I am using the Bayesian method . Instead of using the variances I want to use the coefficients matrix to identify the regimes.

I do the following;

ewise voil(i)=betasys(i)(2,2)
compute swaps=%index(voil)
if swaps(1)==2


Do I have to change any thing else.

Thanks.

Best regards,
Rosen
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

You might want to change the name from voil to something more descriptive, but that's what you would need to force labeling on the 2nd coefficient in the 2nd equation.
istiak
Posts: 29
Joined: Sun Nov 11, 2012 9:03 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by istiak »

Hi Tom,
I am using a two variable model with X and Y. I want the graphs of the response on X only when there is a shock in Y in both the regimes. I used the following code

@MCProcessIRF(model=MSSysRegModel,lower=lower,upper=upper,irf=irf)
spgraph(vfields=1,hfields=2,$
xlabels=||"Regime 1","Regime 2"||,ylabels=||"X","Y"||)
if var=1
table(noprint) / lower(var,3) upper(var,4) lower(var,3) upper(var,4)
do shock=3,4
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)

But I get the message

Subscripting Error. Had Array Reference with (INTEGER). Needed (INTEGER,INTEGER)
## SX27. Illegal Combination of Data Types for Operation
>>>>int) / lower(var,3)<<<<

How the problem can be solved? Thank you so much..
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

I don't know what you are planning with:

if var=1

but that's the wrong syntax for an IF instruction (it should be var==1), and var doesn't seem to be defined anyway. Perhaps you intended

do var=1,1
adrangi
Posts: 45
Joined: Sun Sep 05, 2010 7:23 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by adrangi »

Hi Tom. I've run EEV regime -dependent IRFs before as you can tell from our exchanges on the forum. I've tried it again and get the following error message right off the bet. Hadn't seen this in the past attempts.

## CP18. VARLAGSELECT is not the Name of a PROCEDURE. (Did you forget to SOURCE?)
>>>>@varlagselect(<<<<

It tire to look for it in the directory for the Data. I don't have it there and hadn't needed to do this. I tried it on my old 8.3 version (the one I'd run this on) as well, the same message. Any ideas? I suppose I can go find the procedure and put it in the directory, but this may be signaling other issues. Thanks for any help. Best, Bahram
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

You must have your procedure directory pointing to a location that doesn't exist any longer. Change that on the directories tab of the Preferences.
adrangi
Posts: 45
Joined: Sun Sep 05, 2010 7:23 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by adrangi »

Hi Tom. Thanks. That comment helped. Now I seem to get bogged down on Gibbs Sampling. I can see the progress report and once got up to 87% completed, then it just got stuck there. Any suggestions on moving things along? Thanks much. Bahram
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

Is this the EEV model, or your own?
adrangi
Posts: 45
Joined: Sun Sep 05, 2010 7:23 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by adrangi »

Hi again. Also, Is there a way of doing Gibbs sampling on "silent Mode." I get thousands of lines of sampling output. Much appreciated. Barham
adrangi
Posts: 45
Joined: Sun Sep 05, 2010 7:23 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by adrangi »

Hi. I ran it again, this time on my version 8.3. I got the MCMC estimates of the probabilities but not the IRFs. Instead I got the following error message.

## SR6. Missing a Necessary Parameter. Check Instruction Syntax
The Error Occurred At Location 253, Line 5 of loop/block

Not sure what I'm missing. Any suggestions are appreciated. Thanks much. Barham
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by TomDoan »

adrangi wrote:Hi again. Also, Is there a way of doing Gibbs sampling on "silent Mode." I get thousands of lines of sampling output. Much appreciated. Barham
See the thread starting at https://estima.com/forum/viewtopic.php?p=10414
adrangi
Posts: 45
Joined: Sun Sep 05, 2010 7:23 pm

Re: Ehrmann-Ellison-Valla(2003) Regime-dependent IRF's

Unread post by adrangi »

Hi Tom. I'm still struggling with the EEV. I modified EEV for my 5- variable model. Please see below the part that I think causes the problem. Gibbs sampling works and I get the MCMC estimates of the probabilities of two regimes. Then I get the follwoing error message and no IRF graphs. Not sure what the missing card is. Any help to get me unstuck will be highly appreciated. Thanks much.

"## SC1. Expected Supplementary Card (# ....) Here
>>>>s<<<<"

@MCProcessIRF(model=MSSysRegModel,lower=lower,upper=upper,irf=irf)
spgraph(footer="Responses to CRUDE OIL Shock",vfields=5,hfields=2,$
xlabels=||"Regime 1","Regime2 "||,ylabels=||"BLOSMX",$
"IBOvbz","IPSACH ","MERVALAG","CRUDEOIL"||)
do var=1 , 5
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) 5
# irf(var,shock)
# lower(var,shock) / 2
# upper(var,shock) / 2
end do shock
end do var
spgraph(done)
Post Reply