Draw samples from a logistic distribution.
Samples are drawn from a logistic distribution with specified parameters, loc (location or mean, also median), and scale (>0).
Parameters:Parameter of the distribution. Default is 0.
Parameter of the distribution. Should be greater than zero. Default is 1.
Output shape. If the given shape is, e.g., (m, n, k)
, then m * n * k
samples are drawn. If size is None
(default), a single value is returned if loc
and scale
are both scalars. Otherwise, np.broadcast(loc, scale).size
samples are drawn.
Drawn samples from the parameterized logistic distribution.
See also
scipy.stats.logistic
Notes
The probability density for the Logistic distribution is
where = location and = scale.
The Logistic distribution is used in Extreme Value problems where it can act as a mixture of Gumbel distributions, in Epidemiology, and by the World Chess Federation (FIDE) where it is used in the Elo ranking system, assuming the performance of each player is a logistically distributed random variable.
References
[1] Reiss, R.-D. and Thomas M. (2001), âStatistical Analysis of Extreme Values, from Insurance, Finance, Hydrology and Other Fields,â Birkhauser Verlag, Basel, pp 132-133.Examples
Draw samples from the distribution:
>>> loc, scale = 10, 1 >>> s = np.random.logistic(loc, scale, 10000) >>> count, bins, ignored = plt.hist(s, bins=50)
# plot against distribution
>>> def logist(x, loc, scale): ... return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2) >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\ ... logist(bins, loc, scale).max()) >>> plt.show()
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4