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 4.x.y with your Dynare version:
    >> addpath C:\dynare\4.x.y\matlab
    

    For example, for Dynare 4.5.7 type:

    >> addpath C:\dynare\4.5.7\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 4.5.7 in the standard location, select:
    C:\dynare\4.5.7\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 4.x.y with your Dynare version: Windows

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

For example, for Dynare 4.5.7 type:

>> addpath C:\dynare\4.5.7\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:\Documents and Settings\USERNAME\.octaverc on Windows XP and C:\Users\USERNAME\.octaverc on Windows Vista/7.

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 4.5.7, copy the example model file C:\dynare\4.5.7\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. Download and install Homebrew following the instructions on their site
  2. Install Octave and Dynare via Homebrew
    1. Open Terminal (Applications->Utilities->Terminal)
    2. At the terminal prompt, type:
      brew update && brew upgrade && brew install dynare
      
  3. Open Octave
    1. Open Terminal (Applications->Utilities->Terminal)
    2. At the terminal prompt, type:
      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 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 4.x.y with your Dynare version:
    >> addpath /Applications/Dynare/4.x.y/matlab
    

    For example, for Dynare 4.5.7 type:

    >> addpath /Applications/Dynare/4.5.7/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 4.5.7 in the standard location, select:
    /Applications/Dynare/4.5.7/matlab
    
  4. Apply the setting by clicking Save button

Configuring Octave for Dynare on macOS

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

>> addpath /Applications/Dynare/4.x.y/matlab

For example, for Dynare 4.5.7 type:

>> addpath /Applications/Dynare/4.5.7/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 /home/USERNAME/.octaverc.

Running and editing a Dynare example on macOS

  1. Create a working directory that will hold your Dynare models. For example, /home/USERNAME/work.
  2. Assuming that you are using Dynare 4.5.7, copy the example model file /Applications/Dynare/4.5.7/examples/example1.mod to your working directory.
  3. At the MATLAB or Octave command prompt, type the following to change the working directory:
    >> cd /home/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