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

Release files for mcerp 1.1.1

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

Source distribution (sdist)

Source distribution for mcerp 1.1.1
File Size Uploaded
mcerp-1.1.1.tar.gz 509.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mcerp 1.1.1
File Interpreter ABI Platform
mcerp-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 534.3 kB

Release files / mcerp-1.1.1.tar.gz

Download URL mcerp-1.1.1.tar.gz
Size 509.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ce493fae0429b020754c86bc5f6e8d509fb2063ab1da35059be8c18bceddb90d
BLAKE2b-256 checksum
How to use checksums
a5d4e8b7adefab879b9e8a1c47b208de6a2a7658d41525b0775c0b41a4c58aca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / mcerp-1.1.1-py3-none-any.whl

Download URL mcerp-1.1.1-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1c543880cc864ddf6c3c2390b74572d5b426abab8c9c65a9e9307cdeac9201c
BLAKE2b-256 checksum
How to use checksums
2cb5db908a50b73511c20dd0bc1ae9e3c7cd2f68534028349f9fe40d0ed8f465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.12

1 release file

0.11

1 release file

0.10.1

1 release file

0.10

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

2 release files

0.8.1

2 release files

0.8

2 release 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