Problem with Dynare on Octave (MacOS)

Hi,

I work with Dynare v4.5.6 in Octave version 4.4.0 (up to date) on Mac OS High Sierra and I face the problems when dynare computes stochastic simulations.

Worth to note that this is not a case for Windows Octave.

Basically, the problem occurs in the part of stochastic simulations with any .mod file I tried. As an example, I attach here one particular .mod file.
CA_LS07.mod (3.1 KB)

It computes static and dynamic models derivatives, it returns steady-state results, however, it gives an error afterwards.

Here is a log from the Octave command window:

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.6).
Starting preprocessing of the model file …
Found 12 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1
  • order 2
    Processing outputs …
    done
    Preprocessing completed.

STEADY-STATE RESULTS:

y 0
R 0
pi 0
z 0
deltaq 0
deltay_star 0
y_bar 0
y_star 0
deltae 0
pi_star 0
inflationq 0
interest 0
error: index (,,0): subscripts must be either integers 1 to (2^63)-1 or logicals

Does anyone have similar problems on Octave (Mac OS)? Any possible suggestions where should I look for?

Thanks.

Regards

Do you get information in which line and function that error is triggered?

Hi,

I have a mac (High Sierra, 10.13.6) and your mod file runs without error.

How did you install Dynare? You have to install it with homebrew… The macos package distributed on our site is only for Matlab.

From homebrew you should have Octave 4.4.1 and dynare 4.5.6_2.

best,
Stéphane.

PS Informations related to the macOS package are available on the wiki.

1 Like

Many thanks to the respondents @jpfeifer and @stepan-a !

Yes, I installed it by strictly following the provided wiki-guide, with a usage of homebrew package.
However, I was sloppy at the adding paths for Octave.
I had to add 2 paths:

addpath /usr/local/opt/dynare/lib/dynare/matlab
addpath /Applications/Dynare/4.5.6/matlab

Previously I had only the first path added and it returned an error.
But now it works! Much appreciate for your help!

Best regards

That’s weird… Only the /usr/local/opt/dynare/lib/dynare/matlab (if you did not change the default installation) path is required. The second path you mention is usually the one associated to the Dynare/Matlab package (which is not compatible with Octave). You should never add different versions of Dynare in the Octave path (it is a source of problems, and the result will depend on the ordering of the addpath commands).

Best,
Stéphane.

Thanks Stéphane for following up.
The installation paths were not changed. I also located /usr/local/opt/dynare/lib/dynare/matlab and it is straightly there. Moreover, usr/local/Cellar/dynare/ shows exactly 4.5.6_2 version of dynare. Octave is updated && upgraded, v.4.4.1. OS is Mac OS High Sierra 10.13.6.

It is also written in Wiki guide that for legacy versions of dynare we need to specify path for them:

Dynare 4.3.3 - 4.4.2 on Mac OS X 10.6 or higher

…
…

Octave Setup

  1. Install Octave 3.6.4 via Homebrew (which requires XCode) by following the instructions in the “Simple Installation Instructions” subsection of the “Homebrew” section of this site.
  2. Before executing MOD files, you need to execute the following command at Octave prompt:

addpath /Applications/Dynare/{version}/matlab

I am a little bit puzzled as well with that, however, if you say that it works flawlessly for you, the problem might be idiosyncratic, i.e., holds only for my laptop (but can be fixed with a weird procedure).
Thanks for the help.

Best regards

Hi,

I have the exact same issue with the error

error: index ( , ,0): subscripts must be either integers 1 to (2^63)-1 or logicals

Following your solution, I tried to add the path addpath /Applications/Dynare/4.5.6/matlab However I don’t have a folder in my mac as /Applications/Dynare/…

Any idea how I can resolve this?

Dynare v4.5.6 in Octave version 4.4.0

Thanks for your help!

@stepan-a or @HoutanBastani Do you have any insights here?

@asieeeh that is not a solution. As @stepan-a said, it is incorrect to add multiple dynare paths to your Octave path.

@asieeeh did you install Dynare and Octave via Homebrew? If so, your Octave version should be 4.4.1 not 4.4.0 and your Dynare version should be 4.5.6_3. Please confirm this is the case. Also, please provide the .mod file for which this poses a problem. I confirm that the .mod file posted by the OP works for me.