bundles / scipy latest / scipy / stats / _new_distributions / Uniform
ABCMeta
scipy.stats._new_distributions:Uniform
Signature
def Uniform ( * , a = None , b = None , ** kwargs ) Members
Summary
Uniform distribution.
Extended Summary
The probability density function of the uniform distribution is:
for . This class accepts one parameterization: a for , b for .
Parameters
tol: positive float, optionalThe desired relative tolerance of calculations. Left unspecified, calculations may be faster; when provided, calculations may be more likely to meet the desired accuracy.
validation_policy: {None, "skip_all"}Specifies the level of input validation to perform. Left unspecified, input validation is performed to ensure appropriate behavior in edge case (e.g. parameters out of domain, argument outside of distribution support, etc.) and improve consistency of output dtype, shape, etc. Pass
'skip_all'to avoid the computational overhead of these checks when rough edges are acceptable.cache_policy: {None, "no_cache"}Specifies the extent to which intermediate results are cached. Left unspecified, intermediate results of some calculations (e.g. distribution support, moments, etc.) are cached to improve performance of future calculations. Pass
'no_cache'to reduce memory reserved by the class instance.
Attributes
All parameters are available as attributes.
Methods
supportplotsamplemomentmeanmedianmodevariancestandard_deviationskewnesskurtosispdflogpdfcdficdfccdficcdflogcdfilogcdflogccdfilogccdfentropylogentropy
Notes
The following abbreviations are used throughout the documentation.
PDF: probability density function
CDF: cumulative distribution function
CCDF: complementary CDF
entropy: differential entropy
log-F: logarithm of F (e.g. log-CDF)
inverse F: inverse function of F (e.g. inverse CDF)
The API documentation is written to describe the API, not to serve as a statistical reference. Effort is made to be correct at the level required to use the functionality, not to be mathematically rigorous. For example, continuity and differentiability may be implicitly assumed. For precise mathematical definitions, consult your preferred mathematical text.
Examples
To use the distribution class, it must be instantiated using keyword parameters corresponding with one of the accepted parameterizations.import numpy as np import matplotlib.pyplot as plt from scipy import stats from scipy.stats import Uniform X = Uniform(a=0.09, b=188.73)✓
X.plot()
✗plt.show()
✓
X.support()
✓X.a, X.b, X.ab
✓x = 60.45 X.pdf(x), X.pmf(x)✓
np.allclose(np.exp(X.logccdf(x)), 1 - X.cdf(x))
✓logp = np.log(1 - X.ccdf(x)) np.allclose(X.ilogcdf(logp), x)✓
y = 120.82 np.allclose(X.ccdf(x, y), 1 - (X.cdf(y) - X.cdf(x)))✓
X.mean(), X.median(), X.mode()
✓X.variance(), X.standard_deviation()
✓X.skewness(), X.kurtosis()
✓np.allclose(X.moment(order=6, kind='standardized'), X.moment(order=6, kind='central') / X.variance()**3)✓
np.allclose(np.exp(X.logentropy()), X.entropy())
✓X.sample(shape=(4,))
✗See also
- rv_infrastructure
Tutorial
Aliases
-
scipy.stats.Uniform