Skip to main content

Quantify uncertainty and sensitivities in your models with an industry-grade Monte Carlo library.

Project description

Release Downloads Builds Tests Docs codecov PyPI - Python Version

Quantify uncertainty and sensitivities in your computer models with an industry-grade Monte Carlo library.

Overview

At the heart of all serious forecasting, whether that be of elections, the spread of pandemics, weather, or the path of a rocket on its way to Mars, is a statistical tool known as the Monte Carlo method. The Monte Carlo method, named for the rolling of the dice at the famous Monte Carlo casino located in Monaco, allows you to quantify uncertainty by introducing randomness to otherwise deterministic processes, and seeing what the range of results is.

monaco is a python library for analyzing uncertainties and sensitivities in your computational models by setting up, running, and analyzing a Monte Carlo simulation wrapped around that model. Users can define random input variables drawn using chosen sampling methods from any of SciPy's continuous or discrete distributions (including custom distributions), preprocess and structure that data as needed to feed to their main simulation, run that simulation in parallel anywhere from 1 to millions of times, and postprocess the simulation outputs to obtain meaningful, statistically significant conclusions. Plotting and statistical functions specific to use cases that might be encountered are provided, and repeatability of results is ensured through careful management of random seeds.

Quick Start

First, install monaco:

pip install monaco

Then, copy the two files from the template directory, which contains a simple, well commented Monte Carlo simulation of flipping coins. That link also contains some exercises for you to do, to help you familiarize yourself with how monaco is structured.

After working through the template exercises, check out the other examples for inspiration and more in-depth usage of monaco's features.

Documentation / API Reference / SciPy 2022 Talk

The documentation at https://monaco.readthedocs.io includes:

Monaco was presented at the SciPy 2022 Conference, and the conference resources should give another good overview of the library. Check out the paper, the video of the talk, and the talk's slides and notebooks.

Ecosystem

Other libraries which extend monaco:

  • monaco-dict-utils - A Python library for easily bootstrapping Monaco Monte Carlo simulations with a dictionary-based workflow

License / Citation

Copyright 2020 Scott Shambaugh, distributed under the MIT license.

If you use monaco to do research that gets published, please cite the conference paper using the below or monaco.bib:

W. Scott Shambaugh (2022). Monaco: A Monte Carlo Library for Performing Uncertainty and Sensitivity Analyses. In Proceedings of the 21st Python in Science Conference (pp. 202 - 208).

Further Reading

Project details


Download files

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

Source Distribution

monaco-0.21.0.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

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

monaco-0.21.0-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file monaco-0.21.0.tar.gz.

File metadata

  • Download URL: monaco-0.21.0.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for monaco-0.21.0.tar.gz
Algorithm Hash digest
SHA256 0ec2b4a18d339f2ff24f2438b23aa03d8884cb307663d395fc7de0ad60180805
MD5 d27f74faf85330ecaaa676522fec7baf
BLAKE2b-256 9c1218e6adbe0c669f3843b28c1f6e8cc3d3b6059aa595b8b094778b9823315b

See more details on using hashes here.

Provenance

The following attestation bundles were made for monaco-0.21.0.tar.gz:

Publisher: publish.yml on scottshambaugh/monaco

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

File details

Details for the file monaco-0.21.0-py3-none-any.whl.

File metadata

  • Download URL: monaco-0.21.0-py3-none-any.whl
  • Upload date:
  • Size: 70.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for monaco-0.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be383633a4c410a8ed0e5d18c45181a45d4994ce3c651ae56c0971a6f15424e4
MD5 19c982a131891dee15af2b21416ed264
BLAKE2b-256 a2d3872951fcf8e317851e4cd3f95b90ea62d4cd0f9e4948f009739f8adba796

See more details on using hashes here.

Provenance

The following attestation bundles were made for monaco-0.21.0-py3-none-any.whl:

Publisher: publish.yml on scottshambaugh/monaco

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page