Time-Varying risk

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Time-Varying risk

Postby rteconomics » Wed Jun 20, 2012 9:07 am

Hi guys! I'm working to an SOE model with time-varying risk of the form:

Code: Select all
a=rho*a(-1)+sigma_a*e;
sigma_a=(1-rho_z)*sigma_ss+rho_z*sigma_a(-1)+kappa_a*u;


After specifying the dll option in the 'model' block, I was asked to choose a compiler:

Code: Select all
Select a compiler:
[1] Lcc-win32 C 2.4.1 in I:\w5\MATLAB~3\sys\lcc
 
[0] None


I chose 1 (btw, what is the difference?). As a result, I get this error (and it seems I cannot change to 'None' anymore):

Code: Select all
Error time_var_dynamic.c: 1058  expression too complicated
Error time_var_dynamic.c: 1058  expression too complicated
Error time_var_dynamic.c: 1058  expression too complicated
Error time_var_dynamic.c: 1058  expression too complicated
Error time_var_dynamic.c: 1058  expression too complicated
5 errors, 0 warnings
 
  I:\W5\MATLAB~3\BIN\MEX.PL: Error: Compile of 'time_var_dynamic.c' failed.
 
??? Error using ==> mex at 221
Unable to complete successfully.

Error in ==> time_var at 71
    eval('mex -O PRELINK_CMDS1="echo EXPORTS > mex.def & echo
    mexFunction >> mex.def & echo Dynamic >> mex.def"
    time_var_dynamic.c')

Error in ==> dynare at 132
evalin('base',fname) ;


The same happens with the code posted here (viewtopic.php?f=1&t=2829) by MichelJuillard.

I attach my code.
Could anyone please help? Thanks!
Ciao,
RT
Attachments
soe_timevar.mod
(11.14 KiB) Downloaded 61 times
Last edited by rteconomics on Thu Jun 21, 2012 2:26 pm, edited 1 time in total.
rteconomics
 
Posts: 41
Joined: Wed Jan 04, 2012 11:29 am

Re: Time-Varying risk

Postby rteconomics » Wed Jun 20, 2012 3:27 pm

I forgot to tell you that I'm using the 4.1.3 version. Does this matter? Thanks. RT
rteconomics
 
Posts: 41
Joined: Wed Jan 04, 2012 11:29 am

Re: Time-Varying risk

Postby jpfeifer » Thu Jun 21, 2012 7:09 am

Please upgrade to a newer version. There have been some bugs discovered since then. Moreover, in more recent versions, the use_dll option is not required anymore.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Time-Varying risk

Postby rteconomics » Thu Jun 21, 2012 2:24 pm

Hello!
Thank you for your reply. I did it this morning and the code seems to work fine now. However, I still have a little issue (this is an issue that other might have faced).
I specified the TFP process as:

Code: Select all
sigma_e = rho_sigma_e*sigma_e(-1) + (1-rho_sigma_e)*mean_sigma_e + sigma_eta*eta_e;
a = rho_a*a(-1) + sigma_e*e;


and the 'shocks' block as (I took this from a code MJ posted, see my original post above):

Code: Select all
shocks;
var e = 1;
var eta_e = 1;
end;
stoch_simul(order=3, periods=1000, irf=10);

ex_ = zeros(40,2);
ex_(1,2) = 1;
irf2 = simult_(oo_.steady_state,oo_.dr,ex_,2);

figure;
plot(irf2(2,:)-oo_.steady_state(3));
title('Consumption');


The output are the IRFs relative to e (standard TFP level shock):
[img]
IRFs(lev).pdf
[/img]

to eta (shock to the second moment):
[img]
IRFs(var).pdf
[/img]

and the IRF of consumption:
[img]
consumption.pdf
[/img]

I have 2 questions:
1) Is there a way to smooth the IRFs coming from shocks to eta?
2) What is exactly the difference between the IRF of consumption and the IRF of c in the 'eta shock' case (basically in the second and third figure)? Why are they different and which one is the true one?
Attachments
IRFs(var).pdf
IRFs to eta
(6.44 KiB) Downloaded 85 times
IRFs(lev).pdf
IRFs to e
(6.25 KiB) Downloaded 83 times
consumption.pdf
IRF of consumption
(3.4 KiB) Downloaded 108 times
rteconomics
 
Posts: 41
Joined: Wed Jan 04, 2012 11:29 am

Re: Time-Varying risk

Postby rteconomics » Tue Jun 26, 2012 12:20 pm

Hi guys!
Any news on this issue?
Thank you!
RT
rteconomics
 
Posts: 41
Joined: Wed Jan 04, 2012 11:29 am

Re: Time-Varying risk

Postby jpfeifer » Fri Jun 29, 2012 6:37 pm

1. If you don't do the IRFs in the way the authors of the AER paper proposed, the only way would be to run really many replications, see e.g. http://www.imf.org/external/pubs/ft/wp/2010/wp10249.pdf. Note that pruning also helps but is not implemented for higher orders than 2

2. There is no right or wrong. The ways to compute them are different. stoch_simul generates IRFs as described in http://www.dynare.org/DynareWiki/IrFs. During the whole simulation period there are random shocks hitting the system. The difference between the baseline and the shocked series is a shock at time t=101. IRFs are plotted as the percentage difference between the shocked series and the baseline simulation.

In contrast, by using
Code: Select all
ex_ = zeros(40,2);
ex_(1,2) = 1;

you have 40 periods without any shock except for the first shocks at period 1. Then you compare this shocked series to the deterministic steady state.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests

cron