bundles / scipy latest / scipy / stats / _probability_distribution / _ProbabilityDistribution / support
function
scipy.stats._probability_distribution:_ProbabilityDistribution.support
Signature
def support ( self ) Summary
Support of the random variable
Extended Summary
The support of a random variable is set of all possible outcomes; i.e., the subset of the domain of argument for which the probability density function is nonzero.
This function returns lower and upper bounds of the support.
Returns
out: tuple of ArrayThe lower and upper bounds of the support.
Notes
Suppose a continuous probability distribution has support (l, r). The following table summarizes the value returned by several methods when the argument is outside the support.
+----------------+---------------------+---------------------+ | Method | Value for ``x < l`` | Value for ``x > r`` | +================+=====================+=====================+ | ``pdf(x)`` | 0 | 0 | +----------------+---------------------+---------------------+ | ``logpdf(x)`` | -inf | -inf | +----------------+---------------------+---------------------+ | ``cdf(x)`` | 0 | 1 | +----------------+---------------------+---------------------+ | ``logcdf(x)`` | -inf | 0 | +----------------+---------------------+---------------------+ | ``ccdf(x)`` | 1 | 0 | +----------------+---------------------+---------------------+ | ``logccdf(x)`` | 0 | -inf | +----------------+---------------------+---------------------+
For discrete distributions, the same table is applicable with pmf and logpmf substituted for pdf and logpdf.
For the cdf and related methods of continuous distributions, the inequality need not be strict; i.e. the tabulated value is returned when the method is evaluated at the corresponding boundary.
The following table summarizes the value returned by the inverse methods for arguments 0 and 1, whether the distribution is continuous or discrete.
+-------------+-----------+-----------+ | Method | ``x = 0`` | ``x = 1`` | +=============+===========+===========+ | ``icdf(x)`` | ``l`` | ``r`` | +-------------+-----------+-----------+ | ``icdf(x)`` | ``r`` | ``l`` | +-------------+-----------+-----------+
For the inverse log-functions, the same values are returned for x = log(0) and x = log(1). All inverse functions return nan when evaluated at an argument outside the domain 0 to 1.
Examples
Instantiate a distribution with the desired parameters:from scipy import stats X = stats.Uniform(a=-0.5, b=0.5)✓
X.support()
✗X = stats.Normal()
✓X.support()
✗X.pdf([-100., 100.])
✓X.logpdf([-100., 100.])
✗See also
Aliases
-
scipy.stats._distribution_infrastructure._ProbabilityDistribution.support