The software contains both Matlab/Octave m-functions and functions written in C. Some of the sparse GP functionalities in the toolbox require SuiteSparse toolbox by Tim Davis.

**1. Basic installation without compactly supported
covariance functions **

- Install the GPstuff package by running 'matlab_install' in the GPstuff folder
- With this option you are able to use all the other functions except for gpcf_ppcs*

**2. Installation with compactly supported covariance
functions v3.4 or newer**

Compactly supported (CS) covariance functions are functions that produce sparse covariance matrices (matrices with zero elements). To use these functions you need the sparse GP functionalities in the toolbox which are build over SuiteSparse toolbox by Tim Davis. To take full advantage of the CS covariance functions install GPstuff as follows:

- Install the GPstuff package by running 'matlab_install('SuiteSparseOn')' in the GPstuff folder

**3. Installation with compactly supported covariance
functions v3.3 or older**

- First install SuiteSparse-3.4.0 Note!
- Install also Metis 4.0.1 as mentioned under header "Other packages required:".
- Place a copy of the metis-4.0 directory in the SuiteSparse directory (that is in the directory, where you have Suitesparse_install.m file). Then open Matlab and go to SuiteSparse directory and run Suitesparse_install. This will install the whole SuiteSparse with metis for you
**NOTE!**There are problems with installing SuiteSparse in some architechtures. See the end of this document for known problems and solutions. (Versions 3.4 and later include modified SuiteSparse-3.4 where these problems are fixed)

- After this, install the GPstuff package:
- Run 'matlab_install( suitesparse_path )' in the present directory. Here suitesparse_path is a string telling the path to SuiteSparse package (for example, '/matlab/toolbox/SuiteSparse/'). Note! It is important that suitesparse_path is in right format. Include also the last '/' sign in it. In windows replace / by \.
- The function matlab_install compiles the mex-files and prints on the screen, which directories should be added to Matlab paths.

The package contains the following subdirectories:

diag dist gp mc misc optim xunit SuiteSparse

Each folder contains Contents.m, which summarizes the functions in the folder.

'gp' folder contains the main functionalities and demonstration programs. Other folders contain additional functions.

It is easiest to learn to use the package by running the demos. It is advisable to open the demo files in text editor and run them line by line. The demos are documented so that user can follow what happens on each line.

The user guide gives background material and discusses some of the demos.

The basic structure of the program is as follows. The program consist of separate blocks, which are:

- Gaussian process model structure (GP):

This is a structure that contains all the model information (see gp_set) and information on, which inference scheme is used. GP structure contains covariance function structures (GPCF_*) and likelihood structures (LIK_*). - Covariance function structure (GPCF):

This is a structure that contains all of the covariance function information (see e.g. gpcf_sexp). The structure contains the hyperparameter values, pointers to the subfunctions that are related to the covariance function (e.g. covariance matrix functio) and hyperprior structure. - likelihood structure (LIK_*):

This is a structure that contains all of the likelihood function information (see e.g. lik_probit). The structure contains the likelihood parameter values and pointers to subfunctions that are related to the likelihood function (e.g. log likelihood and its derivatives and MCMC sampler for latent values). - Inference utilities:

Inference utilities consist of functions that are needed to make the posterior inference and predictions. These include, among others,

GP_E - Evaluate conditional log posterior density

GP_G - Evaluate gradient of conditional log posterior

GPEP_PRED - Predictions with Gaussian Process EP

GP_MC - Markov chain Monte Carlo sampling

Versions 3.4 and later include modified SuiteSparse-3.4 where these problems are fixed.

There are some problems with installing SuiteSparse for 64bit Linux, Matlab 7.8 (or newer). The problem can be fixed as told in the Instructions to get through the problems