Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.random.logistic

numpy.random.logistic(loc=0.0,scale=1.0,size=None)

Draw samples from a logistic distribution.

Samples are drawn from a logistic distribution with specifiedparameters, loc (location or mean, also median), and scale (>0).

Parameters:

loc : float or array_like of floats, optional

Parameter of the distribution. Default is 0.

scale : float or array_like of floats, optional

Parameter of the distribution. Should be greater than zero.Default is 1.

size : int or tuple of ints, optional

Output shape. If the given shape is, e.g.,(m,n,k), thenm*n*k samples are drawn. If size isNone (default),a single value is returned ifloc andscale are both scalars.Otherwise,np.broadcast(loc,scale).size samples are drawn.

Returns:

out : ndarray or scalar

Drawn samples from the parameterized logistic distribution.

See also

scipy.stats.logistic
probability density function, distribution or cumulative density function, etc.

Notes

The probability density for the Logistic distribution is

P(x) = P(x) = \frac{e^{-(x-\mu)/s}}{s(1+e^{-(x-\mu)/s})^2},

where\mu = location ands = scale.

The Logistic distribution is used in Extreme Value problems where itcan act as a mixture of Gumbel distributions, in Epidemiology, and bythe World Chess Federation (FIDE) where it is used in the Elo rankingsystem, assuming the performance of each player is a logisticallydistributed random variable.

References

[R237]Reiss, R.-D. and Thomas M. (2001), “Statistical Analysis ofExtreme Values, from Insurance, Finance, Hydrology and OtherFields,” Birkhauser Verlag, Basel, pp 132-133.
[R238]Weisstein, Eric W. “Logistic Distribution.” FromMathWorld–A Wolfram Web Resource.http://mathworld.wolfram.com/LogisticDistribution.html
[R239]Wikipedia, “Logistic-distribution”,http://en.wikipedia.org/wiki/Logistic_distribution

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

>>>deflogist(x,loc,scale):...returnexp((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()

Previous topic

numpy.random.laplace

Next topic

numpy.random.lognormal

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp