Welcome to SPOTPY

A Statistical Parameter Optimization Tool for Python


SPOTPY is a Python framework that enables the use of Computational optimization techniques for calibration, uncertainty and sensitivity analysis techniques of almost every (environmental-) model. The package is puplished in the open source journal PLoS One:

Houska, T., Kraft, P., Chamorro-Chavez, A. and Breuer, L.: SPOTting Model Parameters Using a Ready-Made Python Package, PLoS ONE, 10(12), e0145180, doi:10.1371/journal.pone.0145180, 2015

The simplicity and flexibility enables the use and test of different algorithms without the need of complex codes:

sampler = spotpy.algorithms.sceua(model_setup())     # Initialize your model with a setup file
sampler.sample(10000)                                # Run the model
results = sampler.getdata()                          # Load the results
spotpy.analyser.plot_parametertrace(results)         # Show the results


Complex algorithms bring complex tasks to link them with a model. We want to make this task as easy as possible. Some features you can use with the SPOTPY package are:

Relationship to other packages

A surprisingly small range of similar parameter estimation packages is available

All of them have their pros and cons. To benchmark SPOTPY against these packages would be difficult because of wide variety of settings in different algorithms. The most related one is certainly PyMC, which brings many ideas into this framework. At the moment is PyMC limited to MCMC algorithms when analysing external deterministic models. To test other algorithms in such a straightforward way was the main reason why SPOTPY was developed. Consequently, none of the packages can offer such a wide range of different algorithms like SPOTPY.



The SPOTPY is an open-source package written in pure Python. It runs on all major platforms (Windows, Linux, Mac). SPOTPY requires just some standard packages:

Optional packages are:

all packages are pre-installed e.g. in the following packages:


SPOTPY is available on PYPI and GitHub. This should make installation easy, as you just have to use a command window and type

pip install spotpy

Alternatively, you can download the latest version of SPOTPY with a SVN-Client.

With this software you just have to check out: svn://

The recommended place for the SPOTPY package is in the site-packages folder in your Python Path, just the location of all other Python packages.

Project layout

SPOTPY can work with any parameter distributions. A standard setup uses pre-build distributions from NumPy. To benchmark the model-runs with a value, SPOTPY comes along with a wide range of pre-build objective functions. All algorithms realized in the SPOTPY package can work with the Distributions and objective functions. One can use them for uncertainty-, sensitivity analysis or parameter optimization. The three packages together can be run in any combination and results are stored in the ram storage or in a csv file. The results can be analysed with some pre-build statistics and plotting features.


Above: Overview about functionality of the SPOTPY package             # Ensures that all needed files are loaded.             # Plotting features and statistic analysis.             # Ensures a secure data harbour during the sampling.   # Library of pre-build evaluation functions          # Library of pre-build evaluation functions           # Library of pre-build evaluation functions

algorithms/   # Ensures the availability of all algorithms      # Differential Evolution Markov Chain Monte Carlo        # Latin Hypercube Sampling       # Metropolis Markov Chain Monte Carlo        # Maximum Likelihood Estimation         # Monte Carlo      # Shuffled Complex Evolution         # Simulated annealing       # RObust Parameter Estimation       # Fourier Amplitude Sensitivity Testing        # Artificial Bee Colony     # Fitness Scaled Chaotic Artificial Bee Colony      # Differential Evolution Adaptive Metropolis

parallel/        #Basic Parralel Computing features    #Basic Parralel Computing features      #Basic Parralel Computing features #Basic Parralel Computing features

examples/      # Example SPOTPY setup to analyse the Ackley function    # Example SPOTPY setup to analyse the Griewank function  # Example SPOTPY setup to analyse the Rosenbrock function          # Recommended test file for starters      # Source code for the Rosenbrock example the Tutorial        # Source code for the Rosenbrock example the Tutorial          # Source code for the Rosenbrock example the Tutorial        # Example how to sample given parameter combinations                   # Response surface plot of example files