Jupyter Notebook
# 参考:https://qiita.com/tibigame/items/fa746573fbaf4666bc33 import numpy as np import scipy import matplotlib.pyplot as plt %matplotlib inline import seaborn as sns sns.set(style="whitegrid")
# 指数分布 # 平均して10分に1度起こる現象の発生間隔 rand_exp_scale = 10.0 rand_exp_size = 10000 rand_exp = np.random.exponential(scale=rand_exp_scale, size=rand_exp_size) fig = plt.figure() ax = fig.add_subplot(1,1,1) plt.title('Histgram of np.random.exponential') ax.set_ylabel('Frequency') sns.distplot(rand_exp, kde=False, rug=False, bins=50)
log_rand_exp = np.log(rand_exp ) fig = plt.figure() ax = fig.add_subplot(1,1,1) plt.title('Histgram of Log(np.random.exponential)') ax.set_ylabel('Frequency') sns.distplot(log_rand_exp, kde=False, rug=False, bins=50)
pareto = np.random.pareto(a=2.718281828, size=10000) fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.set_ylabel('freq') sns.distplot(pareto, kde=False, rug=False, bins=50)
# パレート分布 log_pareto = np.log(pareto) fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.set_ylabel('freq') sns.distplot(log_pareto, kde=False, rug=False, bins=50)