add_auxiliary_variables_to_steadystate.m

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.

add_auxiliary_variables_to_steadystate.m

Postby bkjecn » Mon Oct 17, 2011 9:53 pm

Greetings,

I have a model in which Dynare opts to use auxiliary variables. I have and _steadystate.m file that worked fine with 4.2.1. It still works with 4.2.2, eventually, but I get hundreds of warnings that look like this:

Warning: Divide by zero.
> In cmr_static at 147
In add_auxiliary_variables_to_steadystate at 30
In steady_ at 56
In steady at 54
In cmr at 2472
In dynare at 120

I run Mac OSX, Matlab R2009a. The only difference in any of the files from 4.2.1 to 4.2.2 is in add_auxiliary_variables_to_steadystate.m. Several lines were deleted. Those deletions cause my problem. When I run the code with the add_auxiliary_variables_to_steadystate.m file from 4.2.1 and the rest of 4.2.2, everything again works without complaint.

I included in this post a diff for the relevant files to verify the differences. Is there a way that I can avoid these warnings? Was there a reason to delete the lines of code in the m file?

Best,

Ben


bash-3.2$ diff /Applications/Dynare/4.2.1/matlab/steady.m /Applications/Dynare/4.2.2/matlab/steady.m
bash-3.2$ diff /Applications/Dynare/4.2.1/matlab/steady_.m /Applications/Dynare/4.2.2/matlab/steady_.m
bash-3.2$ diff /Applications/Dynare/4.2.1/matlab/add_auxiliary_variables_to_steadystate.m /Applications/Dynare/4.2.2/matlab/add_auxiliary_variables_to_steadystate.m
23,32d22
< k = size(ys,1)+1;
< aux_lead_nbr = 0;
< for i=1:n
< if aux_vars(i).type == 1
< ys1(k) = ys(aux_vars(i).orig_index);
< elseif aux_vars(i).type == 0
< aux_lead_nbr = aux_lead_nbr + 1;
< end
< k = k+1;
< end
34c24
< for i=1:aux_lead_nbr+1;
---
> for i=1:n+1;
45,48c35,36
< if aux_vars(j).type == 0
< el = aux_vars(j).endo_index;
< ys1(el) = ys1(el)-res(el);
< end
---
> el = aux_vars(j).endo_index;
> ys1(el) = ys1(el)-res(el);
bkjecn
 
Posts: 35
Joined: Thu Oct 13, 2011 3:02 am

Re: add_auxiliary_variables_to_steadystate.m

Postby SébastienVillemot » Fri Nov 04, 2011 5:19 pm

Can you post the MOD file which creates the problem?
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 13 guests