Maximum entropy and minimum divergence models in Python

# 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

## Project details

This version 0.3.0 0.2.3
{"ft_lang_label":"__label__en","ft_lang_prob":0.79977137,"math_prob":0.5539491,"size":2011,"snap":"2020-10-2020-16","text_gpt3_token_len":429,"char_repetition_ratio":0.11709019,"word_repetition_ratio":0.02846975,"special_character_ratio":0.19741422,"punctuation_ratio":0.12280702,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9666425,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-04-10T00:30:44Z\",\"WARC-Record-ID\":\"<urn:uuid:2c3804b7-3a09-4d9a-94fd-b41f1bf73403>\",\"Content-Length\":\"47095\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d9e7761d-e5d0-4de7-8765-18647a6fb288>\",\"WARC-Concurrent-To\":\"<urn:uuid:f00d9e63-ff4d-445c-a43f-f7264efc37c4>\",\"WARC-IP-Address\":\"151.101.64.223\",\"WARC-Target-URI\":\"https://pypi.org/project/maxentropy/\",\"WARC-Payload-Digest\":\"sha1:4V54APCI74DWG45ASLFDRXIRTYSCFS6C\",\"WARC-Block-Digest\":\"sha1:KJSC5OB4WGSL4TL2JPOCR63AO3MCIS27\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-16/CC-MAIN-2020-16_segments_1585371880945.85_warc_CC-MAIN-20200409220932-20200410011432-00101.warc.gz\"}"}