Open3

極値統計が面白いので、メモしていく

imaimaiimaimai

極値統計とは

極値分布(きょくちぶんぷ、英: extreme value distribution)とは、確率論および統計学において、ある累積分布関数にしたがって生じた大きさ n の標本 X1,X2, …, Xn のうち、x 以上 (あるいは以下) となるものの個数がどのように分布するかを表す、連続確率分布モデルである。特に最大値や最小値などが漸近的に従う分布であり、河川の氾濫、最大風速、最大降雨量、金融におけるリスク等の分布に適用される。(Wikipedia)

起こりうる限界値が統計的に推測できたりするので、堤防の高さの設計などにも使われる。スポーツへの応用もされていて、世界記録の限界値などを見積もっている(ref. Records in Athletics Through Extreme-Value Theory。設計や人体工学の面からのボトムアップ的アプローチではなく、統計的なトップダウン的アプローチが面白い

imaimaiimaimai

最大値の分布がどうなるかの実験コード

import matplotlib.pyplot as plt
from numpy import random
def make_distibution(dist="", n_sample=1000, n_mxs=1000):
    evts = []
    for i in range(n_mxs):
        if dist == "uniform":
            Xs = random.uniform(high=1,low=-1,size=n_sample)
        if dist == "normal":
            Xs = random.normal(0,1,n_sample)
        if dist == "exp":
            Xs = random.exponential(1,n_sample)
        if dist == "cauthy":
            Xs = random.standard_cauchy(n_sample)
        evts.append(max(Xs))
    return evts

dist1 = random.uniform(high=1,low=-1,size=n_sample)
dist2 = random.normal(0,1,n_sample)
dist3 = random.exponential(1,n_sample)
dist4 = random.standard_cauchy(size=n_sample)
plt.figure(figsize=(20,10))
plt.subplot(241)
plt.hist(dist1, bins = 50)
plt.subplot(242)
plt.hist(dist2, bins = 50)
plt.subplot(243)
plt.hist(dist3, bins = 50)
plt.subplot(244)
plt.hist(dist4, bins = [i*2 for i in range(-24,25)])

evt1 = make_distibution(dist="uniform")
evt2 = make_distibution(dist="normal")
evt3 = make_distibution(dist="exp")
evt4 = make_distibution(dist="cauthy")
plt.subplot(245)
plt.hist(evt1, bins = 50)
plt.subplot(246)
plt.hist(evt2, bins = 50)
plt.subplot(247)
plt.hist(evt3, bins = 50)
plt.subplot(248)
plt.hist(evt4, bins = [i*200 for i in range(50)])

結果が下図。上側が分布。下側がその分布をサンプルに取った極値分布
左から一様分布 正規分布 指数分布 コーシー分布としている

極値分布の収束先は以下の3つある

  1. Gumbel分布 : 指数分布, 正規分布
  2. Frechet分布 : コーシー分布
  3. 負のWeibull分布 : 一様分布