# dask.array.random.logistic

### dask.array.random.logistic(\*args, \*\*kwargs)

Draw samples from a logistic distribution.

This docstring was copied from numpy.random.mtrand.RandomState.logistic.

Some inconsistencies with the Dask version may exist.

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

#### NOTE
New code should use the ~numpy.random.Generator.logistic
method of a ~numpy.random.Generator instance instead;
please see the [Quick start](https://numpy.org/doc/stable/reference/random/index.html#random-quick-start).

* **Parameters:**
  **loc**
  : Parameter of the distribution. Default is 0.

  **scale**
  : Parameter of the distribution. Must be non-negative.
    Default is 1.

  **size**
  : 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.
* **Returns:**
  **out**
  : Drawn samples from the parameterized logistic distribution.

#### SEE ALSO
[`scipy.stats.logistic`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.logistic.html#scipy.stats.logistic)
: probability density function, distribution or cumulative density function, etc.

`random.Generator.logistic`
: which should be used for new code.

### 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 and $s$ = 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

### Examples

Draw samples from the distribution:

```pycon
>>> loc, scale = 10, 1
>>> s = np.random.logistic(loc, scale, 10000)
>>> import matplotlib.pyplot as plt
>>> count, bins, ignored = plt.hist(s, bins=50)
```

#   plot against distribution

```pycon
>>> def logist(x, loc, scale):
...     return np.exp((loc-x)/scale)/(scale*(1+np.exp((loc-x)/scale))**2)
>>> lgst_val = logist(bins, loc, scale)
>>> plt.plot(bins, lgst_val * count.max() / lgst_val.max())
>>> plt.show()
```

<!-- !! processed by numpydoc !! -->
