Skip to main content

Compute Statistical Measures of Divergence

Project description

Divergence

Divergence is a Python package to compute statistical measures of entropy and divergence from probability distributions and samples.

The following functionality is provided:

  • (Information) Entropy
  • Cross Entropy
  • Relative Entropy or Kullback-Leibler Divergence
  • Jensen-Shannon Divergence

The units in which these entropy and divergence measures are calculated can be specified by the user. This is achieved by the argument log_fun, which accepts a function that calculates the logarithm with respect to a particular base. The following units can be realized by the corresponding choice of the argument log_fun in the entropy and divergence calculation functions:

  • bits: base 2 via np.log2
  • nats: base e via np.log
  • dits: base 10 via np.log10

In a Bayesian context, relative entropy can be used as a measure of the information gained by moving from a prior distribution q to a posterior distribution p.

Installation

    pip install divergence

Examples

See the Jupyter notebook Divergence.

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

divergence-0.3.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

divergence-0.3.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file divergence-0.3.0.tar.gz.

File metadata

  • Download URL: divergence-0.3.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for divergence-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e97485c749a5174e96e2a42a7c6d11ac06ba905f1a9733c943665567fcf62755
MD5 00576866c40753a430aec0a733c6c419
BLAKE2b-256 7dcc7f2081448690b1c244241d080f702b919b3c3874973f5dc405878b711118

See more details on using hashes here.

File details

Details for the file divergence-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: divergence-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0.post20200518 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.6

File hashes

Hashes for divergence-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c895455d2b5e9c26a26e52222ff45235e56358424a6bdce510de26c24b1d6113
MD5 7f6f1d2285c745014605cb95961887f8
BLAKE2b-256 a913688b9e9c5e41af3b0de47e73431f555b347600a0444249085189eb042504

See more details on using hashes here.

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