LogoMark.png

Statistics/T-Distribution

t分布

Students T-Distribution

t分布の定義

n個の確率変数 \( x_1, x_2,・・x_n\) がすべて独立で、 \(N(μ,σ^2)\)  に従うとき、以下の統計量 t は 自由度 n-1 の t分布に従う・・と定義されています。

\[ t = \frac{\bar{x} -μ}{ \frac{s}{\sqrt{n}}} \]

t分布の特徴

描画例

以下、Python の統計関数(SciPy.stats)を使って自由度 1, 3, 5 の t分布と正規分布を描画したものです。自由度が大きくなると、t分布は正規分布に近づくことがわかります。

T-Distribution.jpg
# ライブラリの読み込み
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats

# データ列の準備(-3 ~ 3 の間で100個)
x = np.linspace(-3, 3, 100)

# t分布関数グラフの描画
for df in range(1, 6, 2):
    t = stats.t.pdf(x, df)
    plt.plot(x, t, label=f"df={df}")

# 正規分布関数グラフの描画
n = stats.norm.pdf(x)
plt.plot(x,n, label=f"normal")

# 凡例を表示
plt.legend()








PAGES

GUIDE

DATA

添付ファイル: fileT-Distribution.jpg 28件 [詳細]
Last-modified: 2023-11-19 (日) 18:05:55