Replication of sensitivity check

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.

Replication of sensitivity check

Postby songjeo1 » Sun May 17, 2015 11:40 am

Hi everyone,

I am trying to repeat some sensitivity checks for many possible values of parameters in my calibration.

Now, I am manually doing that taking quite a long time. Could anyone give me a tip so that in this DYNARE I can practice something like DO LOOP in GAUSS code?

Always thanks in advance

Song from Korea
songjeo1
 
Posts: 17
Joined: Fri Apr 17, 2015 5:34 am

Re: Replication of sensitivity check

Postby jpfeifer » Sun May 17, 2015 4:49 pm

------------
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: Replication of sensitivity check

Postby songjeo1 » Fri May 22, 2015 8:23 am

Hi everyone,

Bt only modifying the mod file name for my own, I wrote the following M.file in the below.
rho_a is structural parameter that indicates the AR(1) parameter for tech. shock in my mod file.
===================================
rhos = 0.8:0.05:1.05;
first_time = 1;
for i=1:length(rhos)
if first_time
set_param_value('rho_a',rhos(i));
dynare RS_A2.mod noclearall;
first_time = 0;
else
set_param_value('rho_a',rhos(i));
info = stoch_simul(irf);
if info;
disp(['Computation fails for rho = ' num2str(rho_a)]);
end;
end
end
=======================================

The error message in Korean contains

"set_param_value (line 22)
i = strmatch(pname,M_.param_names,'exact'); "

What is wrong with my M.file?
songjeo1
 
Posts: 17
Joined: Fri Apr 17, 2015 5:34 am

Re: Replication of sensitivity check

Postby jpfeifer » Sat May 23, 2015 1:36 pm

Please provide the full files.
------------
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: Replication of sensitivity check

Postby songjeo1 » Mon May 25, 2015 1:29 am

Sorry for my late reply.

My mod file and m files are attached to this post.

RS_A2.mod
This is my MOD file
(8.13 KiB) Downloaded 37 times


sensit.m
This is the M.file
(386 Bytes) Downloaded 39 times


Many thanks to you for your kind help.

Song from Korea
songjeo1
 
Posts: 17
Joined: Fri Apr 17, 2015 5:34 am

Re: Replication of sensitivity check

Postby jpfeifer » Tue May 26, 2015 5:59 pm

You cannot use
Code: Select all
    if first_time
        set_param_value('rho_a',rhos(i));
        dynare RS_A2.mod noclearall;

as you are trying to set rho_a before you run Dynare for the first time where rho_a is then finally defined. Use the mod-file itself to set the first value.
------------
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: Replication of sensitivity check

Postby songjeo1 » Wed May 27, 2015 4:38 am

Dear Prof. Pfeifer,

As you suggested, I have run my dynare mod file, RS_A2.mod first and then have executed the sensit.m file.

But, it seemed to me that RS_A2.mod has been run only one time, not the number of rhos vector, that is, 3.

Song from Korea
songjeo1
 
Posts: 17
Joined: Fri Apr 17, 2015 5:34 am

Re: Replication of sensitivity check

Postby jpfeifer » Wed May 27, 2015 4:26 pm

Your second call to stoch_simul is wrong and should be

Code: Select all
        info = stoch_simul(var_list_);

Moreover, you are not saving any results.
------------
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: Google [Bot] and 7 guests