For using the VineCopulaMatlab toolbox you should first check whether all dependencies are installed.


Installation under linux

With the following code you can check whether you have installed the needed software (C++ compiler, boost libraries, NLopt and OpenMP) on your UNIX system.

$ dpkg -s g++ | grep 'Version'
$ dpkg -s libboost-all-dev | grep 'Version'
$ dpkg -s libnlopt-dev | grep 'Version'
dpkg -s libgomp1 | grep 'Version'

Getting started / Setting up the VineCopulaMatlab toolbox

  1. Check whether you have a compatible C++ compiler (cf. for information about compatible compilers for different releases and operating systems). By the command mex -setup the compiler can be set.
  2. Install the C++ libraries boost (cf.

    $ apt-get install libboost-all-dev

  3. Install the nonlinear optimization library NLopt (

    $ apt-get install libnlopt-dev

  4. Optionally parallel computing with OpenMP can be used. Note that your C++ compiler needs to support parallel computing with OpenMP.

    $ apt-get install libgomp1

  5. Change the path to the directory you have saved the VineCopulaMatlab folder, i.e.,

    $ cd [path]/VineCopulaMatlab

  6. Build the VineCopulaMatlab toolbox using the make command.

    $ make

  7. Install the VineCopulaMatlab toolbox using the make command.

    $ sudo make install

Installation under Windows

Setting up a C++ build environment for Windows

A nice step-by-step guidance can be found at Following the steps for setting up MSYS, Switchable 32- and 64-bit modes and MinGW-w64 you will get a GCC (TDM-GCC MinGW-w64) for Windows including a command window. It also includes OpenMP for parallel computing.

Getting started / Setting up the VineCopulaMatlab toolbox

  1. Download the mex_C++_mingw-w64.xml file from Chappjc's GitHub folder MATLAB. Open the file and add -fopenmp -lgfortran -lgomp -lnlopt -lVineCopulaCPP at the end of line 67 (definition of the variable LINKLIBS) directly after -lmex -lmx -leng -lmat -lmwlapack -lmwblas. Save the file mex_C++_mingw-w64.xml in the private folder of the VineCopulaMatlab toolbox.
  2. The C++ libraries boost (cf. don't need to be build. Just add the include directory when building the toolbox.
  3. The nonlinear optimization library NLopt. If you have set up MingGW-w64 you can just follow the installation guidance, i.e.,

    ./configure --prefix=Installation_Dir
    make install
  4. Build the VineCopulaMatlab toolbox using the make command. You may have to set the boostincludedir option. If the boost libraries files are in the folder C:\BoostDir, then you may set boostincludedir to /c/BoostDir.

    $ make boostincludedir=/c/BoostDir

  5. Install the VineCopulaMatlab toolbox using the make command. Depending on the installation directory (set as prefix) you may need to run msys as admin. You may have to set the prefix and boostincludedir options. If you set prefix to /c/Dir the library files will be placed in C:\Dir\lib and the include files will be placed in C:\Dir\include. Additionally you may want to specify the variables mingwroot (default value = "C:\MinGW\64") and mingw_mex_xml (default value = "mex_C++_mingw-w64.xml"), which specify where you have installed MinGW-w64 and how your mex setup file is called.

    $ make install prefix=/c/Dir boostincludedir=/c/BoostDir


Handling of seeds for random number generation

Boost.Random is used for random number generation in C++ (cf. If you execute installVineCPP there will be generated some seed for random number generation. With the function SetSeedVineCPP you can always set a new one. Further note:

Parallel computing within the VineCopulaMatlab toolbox using OpenMP

The following functions can be (partly) computed in parallel:

For effective usage of the parallelization you should enable nested parallel regions by:


The maximum number (N) of threads generated can be set via: