Skip to main content

maxentropy: Maximum entropy and minimum divergence models in Python

Purpose

This package helps you to construct a probability distribution (Bayesian prior) from prior information that you encode as generalized moment constraints.

You can use it to either:

  1. find the flattest distribution that meets your constraints, using the maximum entropy principle (discrete distributions only)

  2. or find the "closest" model to a given prior model (in a KL divergence sense) that also satisfies your additional constraints.

Background

The maximum entropy principle has been shown [Cox 1982, Jaynes 2003] to be the unique consistent approach to constructing a discrete probability distribution from prior information that is available as "testable information".

If the constraints have the form of linear moment constraints, then the principle gives rise to a unique probability distribution of exponential form. Most well-known probability distributions are special cases of maximum entropy distributions. This includes uniform, geometric, exponential, Pareto, normal, von Mises, Cauchy, and others: see here.

Examples: constructing a prior subject to known constraints

See the notebooks folder.

Quickstart guide

This is a good place to start: Loaded die example (scikit-learn estimator API)

History

This package previously lived in SciPy (http://scipy.org) as scipy.maxentropy from versions v0.5 to v0.10. It was under-maintained and removed from SciPy v0.11. It has since been resurrected and refactored to use the scikit-learn Estimator inteface.

(c) Ed Schofield, 2003-2019

Metadata

Release files for maxentropy 0.3.0

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

Source distribution (sdist)

Source distribution for maxentropy 0.3.0
File Size Uploaded
maxentropy-0.3.0.tar.gz 47.6 kB Details

Release files / maxentropy-0.3.0.tar.gz

Download URL maxentropy-0.3.0.tar.gz
Size 47.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ac00af89312eb910e19e0911cdd2922aee84b2a46c55ea16e64f0c64ed14fb9c
BLAKE2b-256 checksum
How to use checksums
2765aba65609f961a6e6cef14c9d2cc81445c973c9c51317aa5cee2c4213cc09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.3

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