For those who want to quickly have something running, this page explains how to setup Dynare on Windows or macOS and to run your first model (.mod) file.

To run Dynare, you have the choice between running it on MathWorks MATLAB (proprietary) or GNU Octave (free software).

Windows

Using Dynare with MATLAB

  1. Make sure that MATLAB is installed on your computer.
  2. Download and install the latest Dynare package
  3. Open MATLAB
  4. Configure MATLAB for Dynare (see the section below)
  5. Run a Dynare example in MATLAB (see the section below)

Using Dynare with Octave

  1. Download and install the Octave installer
  2. Download and install the latest Dynare package
  3. Open Octave
  4. Configure Octave for Dynare (see the section below)
  5. Run a Dynare example in Octave (see the section below)

Configuring MATLAB for Dynare on Windows

You have two choices. You can either use the command window or the menu entries.

1. Configuring MATLAB using the Command Window on Windows

You will have to do this every time you start MATLAB, as MATLAB will not remember the setting.

  1. Click on the “Command Window”
  2. If you have Dynare installed in the standard location, type the following, replacing x.y with your Dynare version:
    >> addpath C:\dynare\x.y\matlab
    

    For example, for Dynare 6.0 type:

    >> addpath C:\dynare\6.0\matlab
    

2. Configuring MATLAB using the menu entries on Windows

You will only have to do this once as MATLAB will remember the setting the next time you run it.

  1. On the MATLAB Home tab, in the Environment section, click on Set Path
  2. Click Add Folder.... Warning: DO NOT select Add with Subfolders...
  3. Select the matlab subdirectory of your Dynare installation. For example, if you have installed Dynare 6.0 in the standard location, select:
    C:\dynare\6.0\matlab
    
  4. Apply the setting by clicking Save button

Configuring Octave for Dynare on Windows

If you have Dynare installed in the standard location type the following at the Octave command prompt, replacing x.y with your Dynare version: Windows

>> addpath C:\dynare\x.y\matlab

For example, for Dynare 6.0 type:

>> addpath C:\dynare\6.0\matlab

If you don’t want to type this command every time you run Octave, you can put it in a file called .octaverc in your home directory. This file will usually be called C:\Users\USERNAME\.octaverc.

Running and editing a Dynare example on Windows

  1. Create a working directory that will hold your Dynare models. For example, C:\dynare\work.
  2. Assuming that you are using Dynare 6.0, copy the example model file C:\dynare\6.0\examples\example1.mod to your working directory.
  3. At the MATLAB or Octave command prompt, type the following to change the working directory:
    >> cd C:\dynare\work
    
  4. Then type the following to run the example model file:
    >> dynare example1
    
  5. You can edit the example by typing:
    >> edit example1.mod
    


macOS

Using Dynare with MATLAB

  1. Make sure that MATLAB is installed on your computer.
  2. Download and install the latest Dynare package
  3. Open MATLAB
  4. Configure MATLAB for Dynare (see the section below)
  5. Run a Dynare example in MATLAB (see the section below)

Using Dynare with Octave

  1. Install Homebrew
  2. Install Dynare (and Octave) by typing the following in a terminal:
    brew install dynare
    
  3. Open Octave by running the following in a terminal:
    octave --gui
    
  4. Install some Octave add-ons from the Octave prompt (you only have to do it once)
    >> pkg install -forge io statistics control struct optim
    
  5. Configure Octave for Dynare (see the section below)
  6. Run a Dynare example in Octave (see the section below)

Configuring MATLAB for Dynare on macOS

You have two choices. You can either use the command window or the menu entries.

1. Configuring MATLAB using the Command Window on macOS

You will have to do this every time you start MATLAB, as MATLAB will not remember the setting.

  1. Click on the “Command Window”
  2. If you have Dynare installed in the standard location, type the following, replacing x.y with your Dynare version:
    >> addpath /Applications/Dynare/x.y/matlab
    

    For example, for Dynare 6.0 type:

    >> addpath /Applications/Dynare/6.0/matlab
    

2. Configuring MATLAB using the menu entries on macOS

You will only have to do this once as MATLAB will remember the setting the next time you run it.

  1. On the MATLAB Home tab, in the Environment section, click on Set Path
  2. Click Add Folder.... Warning: DO NOT select Add with Subfolders...
  3. Select the matlab subdirectory of your Dynare installation. For example, if you have installed Dynare 6.0 in the standard location, select:
    /Applications/Dynare/6.0/matlab
    
  4. Apply the setting by clicking Save button

Configuring Octave for Dynare on macOS

Type the following at the Octave command prompt:

>> addpath /usr/local/lib/dynare/matlab

If you don’t want to type this command every time you run Octave, you can put it in a file called .octaverc in your home directory. This file will usually be called /Users/USERNAME/.octaverc.

Running and editing a Dynare example on macOS

  1. Create a working directory that will hold your Dynare models. For example, /Users/USERNAME/work.
  2. Assuming that you are using Dynare 6.0, copy the example model file (either /Applications/Dynare/6.0/examples/example1.mod or /usr/local/lib/dynare/examples/example1.mod) to your working directory.
  3. At the MATLAB or Octave command prompt, type the following to change the working directory:
    >> cd /Users/USERNAME/work
    
  4. Then type the following to run the example model file:
    >> dynare example1
    
  5. You can edit the example by typing:
    >> edit example1.mod