Dynare on Mac vs PC - steady state errors

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.

Dynare on Mac vs PC - steady state errors

Postby jd1090 » Fri Jun 02, 2017 11:54 am

Hi,

I've recently switched from using a PC to using a MAC and I encountered some issues. Namely, for some reason, the .mod files that use the non-linear solver fsolve to compute the steady states always result in sizeable residuals all over the model equations on my MAC (even though the .mod files run fine on the PC without any residuals). I've tried using both stable and unstable versions of dynare, but the issue prevails. Other .mod files without fsolve also work fine on both PC and MAC.

The strange thing is that the _steadystate.m file works fine separately (gives rise to accurate steady state values as in PC), but as soon as I run the .mod file, the results in the oo_.steady_state are mostly complex values. There seems to be some sort of mapping bug.

Any suggestions? Thanks

P.S. I'm using Mac OS X Yosemite 10.10.5 and Matlab 2016a.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Sun Jun 04, 2017 3:13 pm

Could you please provide me with the 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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Sun Jun 04, 2017 4:18 pm

Thanks for taking the time to look at it.
Last edited by jd1090 on Mon Jun 12, 2017 6:32 am, edited 1 time in total.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Mon Jun 05, 2017 5:21 pm

We had a look at this and could not replicate the issue on Mac. Could you please try to copy the file to a different folder an run it there. That's a quick check whether there is some file conflict.
------------
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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Tue Jun 06, 2017 5:16 am

That's weird. I've tried copying them to other folders (only three of the above files) and into other versions of dynare, but I always get the following in the .log file:

Starting Dynare (version 4.6-unstable-079bf6c60e6fbc5db99759041cf33b739be0f570).
Starting preprocessing of the model file ...
Found 82 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...
done
Preprocessing completed.

resid: The initial values for the steady state of the following variables are complex:
y_US
c_US
nx_US
uc_US
ul_US
GAMMA_US
l_US
w_US
OMEGA_US
d_US
r_US
pd_US
n_US
PI_US
PIo_US
PHI_US
THETA_US
DELTA_w_US
dDELTA_w_US
erpt_US_US
erpt_x_US
erpt_cpi_US
y_UK
c_UK
d_UK
r_UK
mc_UK
po_UK
pd_UK
n_UK
p_x_UK




Residuals of the static equations:

Equation number 1 : NaN
Equation number 2 : NaN
Equation number 3 : NaN
Equation number 4 : NaN
Equation number 5 : NaN
Equation number 6 : NaN
Equation number 7 : NaN
Equation number 8 : NaN
Equation number 9 : NaN
Equation number 10 : NaN
Equation number 11 : NaN
Equation number 12 : NaN
Equation number 13 : NaN
Equation number 14 : NaN
Equation number 15 : NaN
Equation number 16 : NaN
Equation number 17 : NaN
Equation number 18 : NaN
Equation number 19 : NaN
Equation number 20 : -1
Equation number 21 : NaN
Equation number 22 : NaN
Equation number 23 : NaN
Equation number 24 : NaN
Equation number 25 : NaN
Equation number 26 : 0
Equation number 27 : -0.3
Equation number 28 : NaN
Equation number 29 : 0
Equation number 30 : 0.0050029
Equation number 31 : 0.6965
Equation number 32 : 3.9226
Equation number 33 : NaN
Equation number 34 : NaN
Equation number 35 : 0
Equation number 36 : NaN
Equation number 37 : -Inf
Equation number 38 : NaN
Equation number 39 : Inf
Equation number 40 : -1.2969
Equation number 41 : 0
Equation number 42 : Inf
Equation number 43 : NaN
Equation number 44 : -Inf
Equation number 45 : Inf
Equation number 46 : -Inf
Equation number 47 : -1
Equation number 48 : Inf
Equation number 49 : -1
Equation number 50 : -1.5
Equation number 51 : 3
Equation number 52 : NaN
Equation number 53 : NaN
Equation number 54 : -1
Equation number 55 : -1
Equation number 56 : 1.6667
Equation number 57 : NaN
Equation number 58 : -Inf
Equation number 59 : NaN
Equation number 60 : 1
Equation number 61 : NaN
Equation number 62 : Inf
Equation number 63 : 3.1875
Equation number 64 : NaN
Equation number 65 : NaN
Equation number 66 : NaN
Equation number 67 : 2.467
Equation number 68 : NaN
Equation number 69 : 0
Equation number 70 : 0.66167
Equation number 71 : 0
Equation number 72 : NaN
Equation number 73 : 0
Equation number 74 : NaN
Equation number 75 : -0.62728
Equation number 76 : NaN
Equation number 77 : NaN
Equation number 78 : 0.023079
Equation number 79 : 0
Equation number 80 : -0.011555
Equation number 81 : -1
Equation number 82 : 4


{Error using <a href="matlab:matlab.internal.language.introspective.errorDocCallback('print_info', '/Applications/dynare 4.6-osx/matlab/print_info.m', 76)" style="font-weight:bold">print_info</a> (<a href="matlab: opentoline('/Applications/dynare 4.6-osx/matlab/print_info.m',76,0)">line 76</a>)
The steadystate file did not compute the steady state
Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('steady', '/Applications/dynare 4.6-osx/matlab/steady.m', 104)" style="font-weight:bold">steady</a> (<a href="matlab: opentoline('/Applications/dynare 4.6-osx/matlab/steady.m',104,0)">line 104</a>)
print_info(info,options_.noprint, options_);
Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('erpt', '/Applications/Dynare/4.4.3/matlab/erpt_distribution_smm/check/erpt.m', 600)" style="font-weight:bold">erpt</a> (<a href="matlab: opentoline('/Applications/Dynare/4.4.3/matlab/erpt_distribution_smm/check/erpt.m',600,0)">line 600</a>)
steady;
Error in <a href="matlab:matlab.internal.language.introspective.errorDocCallback('dynare', '/Applications/dynare 4.6-osx/matlab/dynare.m', 223)" style="font-weight:bold">dynare</a> (<a href="matlab: opentoline('/Applications/dynare 4.6-osx/matlab/dynare.m',223,0)">line 223</a>)
evalin('base',fname) ;}
erpt_steadystate.m
{Undefined variable "erpt_steadystate" or class "erpt_steadystate.m".}
erpt_steadystate

<a href = "matlab: helpview([docroot '/tool


such that the steady states that are in oo_.steady_state are:

NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
NaN + NaNi
1.00000000000000 + 0.00000000000000i
4.00000000000000 + 0.00000000000000i
NaN + NaNi
NaN + NaNi
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.661666666666667 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
NaN + NaNi
NaN + NaNi
NaN + NaNi
4.00000000000000 + 0.00000000000000i
4.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
-0.0230790845075262 + 0.121114052717325i
NaN + NaNi
NaN + NaNi
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.666666666666667 + 0.00000000000000i
2.66666666666667 + 0.00000000000000i
0.700000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
0.372724332599842 - 2.29840864753238i
0.0230790845075262 - 0.121114052717325i
-1.50539871502855e-05 - 5.47920322972983e-06i
4.00000000000000 + 0.00000000000000i
NaN + NaNi
NaN + NaNi
1.46703228259499 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
1.00000000000000 + 0.00000000000000i
NaN + NaNi
0.999997080744763 - 1.08639763851670e-11i
-0.000357710188133353 - 1.33123023715598e-09i
0.999998478862161 - 4.49151522320393e-06i
-1.52113783935537e-06 - 4.49151522320393e-06i
-0.546872770003802 - 2.03520520818762e-06i
-0.546874168127744 + 2.45629738768965e-06i
0.250000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i
0.00000000000000 + 0.00000000000000i


while the _steadystate.m file gives:

ans =
1.0e+03 *
0.0001
0.0000
0.0001
1.0306
-0.3021
3.3958
0.0003
0.0003
-0.0169
0.0000
0.0010
0.0005
0.0006
0.0004
0.0001
0.0007
0.0002
0.0001
0.0001
0.0001
0.0010
0.0010
0.0010
0.0010
0
0
0.0600
0.0010
0
0
0.0010
0.0000
0.0016
0.0010
0.0010
0.0010
0.0010
0.0000
0.0002
0.0001
0.0000
0.0002
0.0002
-0.0001
0.0186
-0.0063
0.0613
0.0003
0.0004
0.0169
0.0000
0.0010
0.0007
0.0008
0.0015
0.0001
0.0006
0.0002
0.0001
0.0000
0.0001
0.0010
0.0010
0.0010
0.0010
0
0
0.0600
0.0010
0
0
0.0010
0.0000
0.0006
0.0010
0.0010
0.0010
0.0000
0.0010
0.0004
0.0002
-0.0000
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Tue Jun 06, 2017 6:29 am

Have you tried debugging the program to see what is going on, i.e. setting a breakpoint in the steady state file?
------------
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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Tue Jun 06, 2017 7:37 am

Yes, it seems to work fine until the fsolve is called. After that, the computations break down. It's odd, because I borrowed some code from a colleague and I managed run his code with fsolve, but it is specified without a separate steady state file (i.e. it's all in one .m file and the .m file itself generates a .mod file).
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Tue Jun 06, 2017 9:56 am

But what does fsolve say? Is there any error code/indication that things go wrong?
------------
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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Tue Jun 06, 2017 10:57 am

No, there is no error message in fsolve - the usual output comes out:

erpt_steadystate

Equation solved.

fsolve completed because the vector of function values is near zero
as measured by the default value of the function tolerance, and
the problem appears regular as measured by the gradient.

<stopping criteria details>


Basically, no matter where the breaking point is, the .mod file somehow spits out crazy steady state values in the oo_, while the _steadystate.m file can be stopped at any point and runs perfectly fine. The values in the oo_ don't seem to depend on where the breaking point is. It is as though the .mod file does not recognise the _steadystate.m file at all.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Wed Jun 07, 2017 6:31 am

What do you mean with
does not recognise the _steadystate.m file at all

Is the output of fsolve still correct and the problem is introduced later on? Or is the fsolve output already complex?
------------
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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Wed Jun 07, 2017 7:28 am

The output of fsolve is correct. The problem is introduced with command 'steady' in the .mod file, when the _steadystate.m file is called.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Dynare on Mac vs PC - steady state errors

Postby jpfeifer » Wed Jun 07, 2017 2:19 pm

Then please trace the error further. During the call to the mod-file, the steady_state-file including fsolve seems to be called correctly. There must then be a transformation happening that implies the values found by fsolve are not passed back unaltered. Or do things go wrong the second time the steady state file is called? Because the
Code: Select all
steady;

command should call the steady state file a second time.
------------
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: Dynare on Mac vs PC - steady state errors

Postby jd1090 » Mon Jun 12, 2017 6:34 am

Just in case someone else encounters a similar problem, I want to say that I've given up trying to debug this. I'll be doing my dynare work on the PC. But if you figure out why this is happening - drop me a line. I'd appreciate it.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests