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


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.

Files for LogUniform, version 2.0.0
Filename, size File type Python version Upload date Hashes
Filename, size LogUniform-2.0.0.tar.gz (6.3 kB) File type Source Python version None Upload date Hashes View
Filename, size LogUniform-2.0.0-py3-none-any.whl (5.5 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page