Skip to main content

MCERP

MCERP

Real-time latin-hypercube sampling-based Monte Carlo ERror Propagation for Python

Tests Documentation Ruff

codecov Quality Gate Status License

PyPI Downloads Python versions

Overview

mcerp is a stochastic calculator for Monte Carlo methods that uses latin-hypercube sampling to perform non-order specific error propagation (or uncertainty analysis).

With this package you can easily and transparently track the effects of uncertainty through mathematical calculations. Advanced mathematical functions, similar to those in the standard math module, and statistical functions like those in the scipy.stats module, can also be evaluated directly.

If you are familiar with Excel-based risk analysis programs like @Risk, Crystal Ball, ModelRisk, etc., this package will work wonders for you (and probably even be faster!) and give you more modelling flexibility with the powerful Python language. This package also doesn't cost a penny, compared to those commercial packages which cost thousands of dollars for a single-seat license. Feel free to copy and redistribute this package as much as you desire!

  1. Transparent calculations. No or little modification to existing code required.

  2. Basic NumPy support without modification. (I haven't done extensive testing, so please let me know if you encounter bugs.)

  3. Advanced mathematical functions supported through the mcerp.umath sub-module. If you think a function is in there, it probably is. If it isn't, please request it!

  4. Easy statistical distribution constructors. The location, scale, and shape parameters follow the notation in the respective Wikipedia articles and other relevant web pages.

  5. Correlation enforcement and variable sample visualization capabilities.

  6. Probability calculations using conventional comparison operators.

  7. Advanced Scipy statistical function compatibility with package functions. Depending on your version of Scipy, some functions might not work.

Installation

You have several easy, convenient options to install the mcerp package.

pip

pip install mcerp

To install with plotting support:

pip install mcerp[plot]

To install all optional dependencies:

pip install mcerp[all]

uv

uv add mcerp
uv sync

Or in an existing uv environment:

uv pip install mcerp

git

To install the latest version from git:

pip install --upgrade "git+https://github.com/eggzec/mcerp.git#egg=mcerp"

Requirements

  • Python >=3.10
  • NumPy : Numeric Python
  • SciPy : Scientific Python (the nice distribution constructors require this)
  • Matplotlib : Python plotting library (optional)

See Also

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcerp-1.1.1.tar.gz (509.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcerp-1.1.1-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file mcerp-1.1.1.tar.gz.

File metadata

  • Download URL: mcerp-1.1.1.tar.gz
  • Upload date:
  • Size: 509.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcerp-1.1.1.tar.gz
Algorithm Hash digest
SHA256 ce493fae0429b020754c86bc5f6e8d509fb2063ab1da35059be8c18bceddb90d
MD5 e7832c01c47ff3d4a9a8d91ef7b51b69
BLAKE2b-256 a5d4e8b7adefab879b9e8a1c47b208de6a2a7658d41525b0775c0b41a4c58aca

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcerp-1.1.1.tar.gz:

Publisher: publish_dist.yml on eggzec/mcerp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcerp-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcerp-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcerp-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1c543880cc864ddf6c3c2390b74572d5b426abab8c9c65a9e9307cdeac9201c
MD5 70fa0f42da6c6190270ec434555c059f
BLAKE2b-256 2cb5db908a50b73511c20dd0bc1ae9e3c7cd2f68534028349f9fe40d0ed8f465

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcerp-1.1.1-py3-none-any.whl:

Publisher: publish_dist.yml on eggzec/mcerp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.12

1 file

0.11

1 file

0.10.1

1 file

0.10

1 file

0.9.7

1 file

0.9.6

1 file

0.9.5

1 file

0.9.4

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.9

2 files

0.8.1

2 files

0.8

2 files

0.2.0

2 files

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