The Python package `kramersmoyal` provides functions to analyze stochastic drift-diffusion and discontinuous stochastic processes in observational and experimental data.


What kramersmoyal can do for you


Understanding complex processes in nature often necessitates describing them as stochastic processes that split the dynamics into a deterministic and a fluctuating part.

The coefficients that quantify these stochastic processes can be obtained from time series via the Kramers-Moyal expansion.
Deriving these Kramal-Moyal Coefficients makes valuable insights into the underlying dynamics accessible.

The Python package kramersmoyal offers a comprehensive way to derive these coefficients for multi-dimensional time series.
It was developed at the Institute of Energy and Climate Research at the Forschungszentrum Jülich GmbH and is available at
It can be installed via pip from PyPI (

Some basic examples of how to use kramersmoyal can be found in the Github repository and documentation is available at Specifically, an example of a one-dimensional and a two-dimensional stochastic process is provided both in the documentation and as a jupyter notebook kmc.ipynb.

A more detailed description of the package and the underlying theory is published in the peer-reviewed article in the The Journal of Open Source Software (DOI: 10.21105/joss.01693).


If you use kramersmoyal in your research, please cite it as:

Rydin Gorjão, L., and Meirinhos, F. (2019). kramersmoyal: Kramers--Moyal coefficients for stochastic processes. Journal of Open Source Software, 4(44), 1693. DOI: 10.21105/joss.01693


The authors acknowledge the funding by the Helmholtz Association vias the Initiative Energy System 2050 - A Contribution of the Research Field Energy, grant No. VH-NG-1025, and STORM - Stochastics for Time-Space Risk Models project of the Research Council of Norway (RCN) No. 274410.

Programming languages
  • Python 85%
  • TeX 15%
  • MIT
</>Source code

Participating organisations

Forschungszentrum Jülich

Reference papers



Leonardo Rydin Gorjão
Norwegian University of Life Sciences