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.

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.

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:

[quote]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 print_info (line 76)
The steadystate file did not compute the steady state
Error in steady (line 104)
print_info(info,options_.noprint, options_);
Error in erpt (line 600)
steady;
Error in dynare (line 223)
evalin(‘base’,fname) ;}
erpt_steadystate.m
{Undefined variable “erpt_steadystate” or class “erpt_steadystate.m”.}
erpt_steadystate

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).

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

[quote]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.

[/quote]

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.

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

command should call the steady state file a second time.

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.