Skip to content

stoch_simul_MMB.m: "set_state_space: function called with too many inputs" with Dynare 5.x+ and Octave #175

@garciasealvaro

Description

@garciasealvaro

Describe the bug
When running MMB using GNU Octave 8.4.0 and a modern version of Dynare (5.x or 6.x), the simulation crashes inside stoch_simul_MMB.m.

The error occurs because MMB calls set_state_space with 3 arguments (dr, M_, options_), but in newer Dynare versions, this function signature has changed (it no longer accepts options_ and handles get_nvars_state_space internally).

To Reproduce
Steps to reproduce the behavior:

  1. Install GNU Octave (tested on 8.4.0) and Dynare (5.x or higher) on Ubuntu.
  2. Open Octave and add Dynare/MMB paths.
  3. Run mmb and select any model to simulate (e.g., standard stochastic simulation).
  4. See error in the command window.

Expected behavior
The simulation should run to completion, calculating IRFs and variances, automatically detecting the Dynare version to use the correct function arguments.

Screenshots
(No screenshots needed, but here is the traceback):
error: set_state_space: function called with too many inputs
error: called from
set_state_space.m at line -1
stoch_simul_MMB.m at line 139 column 12
run_dynare_and_simulate.m at line 17 column 1
run_model_with_rules.m at line 52 column 5
mmb.m at line 41 column 1

Desktop (please complete the following information):

  • OS: Linux (Ubuntu)
  • Platform: GNU Octave
  • Version: 8.4.0
  • Dynare Version: 6.0

Additional context
The issue is located in stoch_simul_MMB.m around line 139.

The legacy code calls:
oo_.dr = set_state_space(dr, M_, options_);
[oo_.dr.nstatic, oo_.dr.npred, oo_.dr.nboth, oo_.dr.nfwrd,oo_.dr.nsfwrd] = get_nvars_state_space(dr,M_);

In Dynare 5+, set_state_space only accepts (dr) or (dr, M_) and get_nvars_state_space has been removed/deprecated, causing a cascade of errors if the first one is bypassed.
I have a working fix locally that checks dynare_version to apply the correct signature. I will submit a Pull Request shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions