10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ロジスティック分布をPythonで

Last updated at Posted at 2014-04-29

numpyを使ってロジスティック分布を書いてみました。

import numpy as np
from  matplotlib import pyplot as plt

sigma = 1.0
mu = 0

x = np.arange(-5., 5., 0.001)
y = np.exp(-(x-mu)/sigma) / (sigma*(1+np.exp(-(x-mu)/sigma))**2)
    plt.plot(x, y)

plt.show()

こんな感じ。
logistics.png

累積分布も

import numpy as np
from matplotlib import pyplot as plt

sigma = 1.0
mu = 0

x = np.arange(-5., 5., 0.001)
y = 1. /(1 + (np.exp(-(x-mu)/sigma)))
plt.plot(x, y)

plt.show()

ロジスティック累積.png

参考文献

numpy+matplotlibで正規分布 - Soleil cou coupé
ロジスティック分布 - Wikipedia

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?