Skip to main content

pyeee - Parameter screening of computational models

A Python library for parameter screening of computational models using Morris' method of Elementary Effects or its extension of Efficient/Sequential Elementary Effects by Cuntz, Mai et al. (Water Res Research, 2015).

DOI PyPI version License Build Status

Coverage Status Documentation Status

About pyeee

pyeee is a Python library for performing parameter screening of computational models. It uses Morris' method of Elementary Effects and also its extension of Efficient or Sequential Elementary Effects published of

Cuntz, Mai et al. (2015)
Computationally inexpensive identification of noninformative model parameters by sequential screening
Water Resources Research 51, 6417-6441, doi:10.1002/2015WR016907.

pyeee can be used with Python functions but wrappers are provided to use it with executables as well. Function evaluation can be distributed with Python's multiprocessing or via MPI.

Documentation

The complete documentation for pyeee is available from Read The Docs.

http://pyeee.readthedocs.org/en/latest/

Quick usage guide

Simple Python function

Consider the Ishigami-Homma function: $y = \sin(x_0) + a,\sin(x_1)^2 + b,x_2^4\sin(x_0)$.

Taking $a = b = 1$ gives:

	import numpy as np
	def ishigami1(x):
	   return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0])

The three paramters $x_0$, $x_1$, $x_2$ follow uniform distributions between $-\pi$ and $+\pi$.

Morris' Elementary Effects can then be calculated like:

	npars = 3
	# lower boundaries
	lb = np.ones(npars) * (-np.pi)
	# upper boundaries
	ub = np.ones(npars) * np.pi

    # Elementary Effects
	from pyeee import ee
    np.random.seed(seed=1023) # for reproducibility of examples
	out = ee(ishigami1, lb, ub)

which gives the Elementary Effects ($\mu*$):

    # mu*
    print("{:.1f} {:.1f} {:.1f}".format(*out[:,0]))
    # gives: 212.4 0.6 102.8

Sequential Elementary Effects distinguish between informative and uninformative parameters using several times Morris' Elementary Effects:

	# screen
	from pyeee import eee
    np.random.seed(seed=1023) # for reproducibility of examples
	out = eee(ishigami1, lb, ub)

which returns a logical ndarray with True for the informative parameters and False for the uninformative parameters:

    print(out)
    [ True False  True]

Python function with extra parameters

The function for pyeee must be of the form func(x). Use Python's partial from the functools module to pass other function parameters.

For example pass the parameters $a$ and $b$ to the Ishigami-Homma function.

	from functools import partial

	def ishigami(x, a, b):
	   return np.sin(x[0]) + a * np.sin(x[1])**2 + b * x[2]**4 * np.sin(x[0])

	def call_ishigami(ishi, a, b, x):
	   return ishi(x, a, b)

	# Partialise function with fixed parameters
	a = 0.5
	b = 2.0
	func   = partial(call_ishigami, ishigami, a, b)
	npars = 3

	# lower boundaries
	lb = np.ones(npars) * (-np.pi)
	# upper boundaries
	ub = np.ones(npars) * np.pi

    # Elementary Effects
	out = ee(func, lb, ub)

partial passes $a$ and $b$ to the function call_ishigami already during definition so that pyeee can then simply call it as func(x), so that x is passed to call_ishigami as well.

Function wrappers

pyeee provides wrappers to use with partial.

	from pyeee import func_wrapper
	args = [a, b]
	kwargs = {}
	func = partial(func_wrapper, ishigami, args, kwargs)

	# screen
	out = eee(func, lb, ub)

There are wrappers to use with Python functions with or without masking parameters, as well as wrappers for external executables. See the documentation for details.

http://pyeee.readthedocs.org/en/latest/

Installation

The easiest way to install is via pip::

pip install pyeee

See the installation instructions in the documentation for more information.

Requirements:

License

pyeee is distributed under the MIT License.
See the LICENSE file for details.

Copyright (c) 2012-2019 Matthias Cuntz, Juliane Mai

Contributing to pyeee

Users are welcome to submit bug reports, feature requests, and code contributions to this project through GitHub.
More information is available in the Contributing guidelines.

Metadata

Release files for pyeee 0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyeee 0.7
File Size Uploaded
pyeee-0.7.tar.gz 61.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyeee 0.7
File Interpreter ABI Platform
pyeee-0.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 106.1 kB

Release files / pyeee-0.7.tar.gz

Download URL pyeee-0.7.tar.gz
Size 61.7 kB
Tags Source
SHA-256 checksum
How to use checksums
95029200969a5f57ace51d73282e9c9e37f8724ef58606688816e1c6d3b35771
BLAKE2b-256 checksum
How to use checksums
4a34d01e0c016b240aefe829b125b7f58f691bc80a159d121302356b77ba8338
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0

Release files / pyeee-0.7-py2.py3-none-any.whl

Download URL pyeee-0.7-py2.py3-none-any.whl
Size 44.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
68e17248bfcacf024c66dbb03c03659fc3768be05bf1a3ab087746965a1fc8de
BLAKE2b-256 checksum
How to use checksums
331e855ef80f666cbd5c22cd88da87c86672544bbe8b173b4201927787b2a9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0

Release history Release notifications | RSS feed

4.1.9

2 release files

4.1.8

2 release files

4.1.7

2 release files

4.1.6

2 release files

4.1.5

2 release files

4.1.4

2 release files

4.1.3

2 release files

4.1.2

2 release files

4.1.1

2 release files

4.1

2 release files

4.0

2 release files

3.0

2 release files

2.1

2 release files

2.0

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.9

2 release files

0.8

2 release files

This release

0.7 This release

2 release files

0.6

2 release files

0.5

1 release file

0.4.1

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page