0
0

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.

ガウス分布とポアソン分布をqq-plotする

Posted at

#Import

import numpy as np
from scipy import stats
import matplotlib.pyplot as plt

#乱数を生成
ガウス分布、ポアソン分布に従う乱数をそれぞれ10000個生成する。

norm = np.random.normal(0, 1, 10000)#平均0、標準偏差1
poisson = np.random.poisson(lam=10, size=10000)#λ=10

これをヒストグラムで図示する。
download.png
download-1.png
#qq-plot
正規分布をqq-plotする。

stats.probplot(gaussian, dist='norm', plot=plt)
plt.show()

download-2.png
次にポアソン分布をqq-plotする。

stats.probplot(poisson, dist='poisson', sparams=10, plot=plt)#λ=10
plt.show()

download.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?