SPOTPY

Welcome to SPOTPY

A Statistical Parameter Optimization Tool for Python

Purpose

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

Features

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.

Installation

Dependencies

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:

Download

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://fb09-pasig.umwelt.uni-giessen.de/spotpy/trunk

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.

Overview

Above: Overview about functionality of the SPOTPY package

__init__.py             # Ensures that all needed files are loaded.
analyser.py             # Plotting features and statistic analysis.
database.py             # Ensures a secure data harbour during the sampling.
objectivefunctions.py   # Library of pre-build evaluation functions
likelihoods.py          # Library of pre-build evaluation functions
signatures.py           # Library of pre-build evaluation functions

algorithms/
    __init__.py   # Ensures the availability of all algorithms
    demcz.py      # Differential Evolution Markov Chain Monte Carlo
    lhs.py        # Latin Hypercube Sampling
    mcmc.py       # Metropolis Markov Chain Monte Carlo
    mle.py        # Maximum Likelihood Estimation
    mc.py         # Monte Carlo
    sceua.py      # Shuffled Complex Evolution
    sa.py         # Simulated annealing
    rope.py       # RObust Parameter Estimation
    fast.py       # Fourier Amplitude Sensitivity Testing
    abc.py        # Artificial Bee Colony
    fscabc.py     # Fitness Scaled Chaotic Artificial Bee Colony
    dream.py      # Differential Evolution Adaptive Metropolis

parallel/
    mpi.py        #Basic Parralel Computing features 
    mpipool.py    #Basic Parralel Computing features 
    mproc.py      #Basic Parralel Computing features 
    sequential.py #Basic Parralel Computing features

examples/
    spotpy_setup_ackley.py      # Example SPOTPY setup to analyse the Ackley function 
    spotpy_setup_griewank.py    # Example SPOTPY setup to analyse the Griewank function
    spotpy_setup_rosenbrock.py  # Example SPOTPY setup to analyse the Rosenbrock function
    getting_started.py          # Recommended test file for starters
    tutorial_rosenbrock.py      # Source code for the Rosenbrock example the Tutorial
    tutorial_griewank.py        # Source code for the Rosenbrock example the Tutorial
    tutorial_ackley.py          # Source code for the Rosenbrock example the Tutorial
    tutorial_Parameterlist_iterator.py        # Example how to sample given parameter combinations
    3dplot.py                   # Response surface plot of example files