Logistic distribution in Python

I wrote a logistic distribution using 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()

Like this. logistics.png

Cumulative distribution

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

References

Normal distribution with numpy + matplotlib --Soleil cou coupé [Logistic distribution-Wikipedia](http://ja.wikipedia.org/wiki/%E3%83%AD%E3%82%B8%E3%82%B9%E3%83%86%E3%82%A3% E3% 83% 83% E3% 82% AF% E5% 88% 86% E5% B8% 83)

Recommended Posts

Logistic distribution in Python
Write beta distribution in Python
Generate U distribution in Python
Mixed normal distribution implementation in python
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
I implemented Cousera's logistic regression in Python
Daily AtCoder # 36 in Python
Clustering text in Python
Implement Enigma in python
Daily AtCoder # 32 in Python
Daily AtCoder # 6 in Python
Daily AtCoder # 18 in Python
Edit fonts in Python
Singleton pattern in Python
File operations in Python
Read DXF in python
Daily AtCoder # 53 in Python
Key input in Python
Use config.ini in Python
Solve ABC168D in Python
Daily AtCoder # 7 in Python