Skip to main content

Implementation of the log-uniform and modified log-uniform distributions

Project description

A simple implementation of the log-uniform and modified log-uniform distributions.

License MIT Travis build PyPI version

How to use

Install it from pip (LogUniform only depends on numpy)

pip install LogUniform

and it’s ready to use from Python

import loguniform

LogUniform comes with two simple classes, LogUniform and ModifiedLogUniform. They are intended to mimic the API of scipy.stats (actually, the log-uniform distribution is already implemented in scipy.stats.reciprocal; the two implementations are compatible).

from loguniform import LogUniform, ModifiedLogUniform

d1 = LogUniform(a=1, b=1000)
d2 = ModifiedLogUniform(knee=1, b=1000)

both distributions d1 and d2 now have methods

  • pdf(x) and logpdf(x): the probability density function and its logarithm

  • cdf(x): cumulative density function

  • ppf(x): percent point function (inverse of cdf)

  • rvs(size): draw random samples from the distribution

  • support(): support of the distribution

License

Copyright 2021 João Faria.

LogUniform is free software made available under the MIT License. For details see the LICENSE file.

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

LogUniform-2.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

LogUniform-2.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file LogUniform-2.0.0.tar.gz.

File metadata

  • Download URL: LogUniform-2.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for LogUniform-2.0.0.tar.gz
Algorithm Hash digest
SHA256 e2b548a889292dd4aad18bdd3d0c2e8da7afff9155a4d31c800d1e2497c0b878
MD5 8fcdf8191ec91fcdd498861fed205b08
BLAKE2b-256 f3c86ec6ef1607305087cd5b8649b6dc1a6ad09ac40c7ee36d254576a09ea641

See more details on using hashes here.

File details

Details for the file LogUniform-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: LogUniform-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10

File hashes

Hashes for LogUniform-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b5507839c6491cf4901f1a0d03915c57de8c8212ebcc1378658384daf919056
MD5 b06d09db23db017afc4e3a244fe8a9a4
BLAKE2b-256 55b415ad6bc589e5b2f8481ccdf841e2f0786f8477df117300599be1df1e4d92

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