仮説の定式化とシミュレーション

Pythonで学ぶ統計思考(パート2)

Justin Bois

Lecturer at the California Institute of Technology

2008年 米国スイングステートの選挙結果

ch3-1.002.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

ch3-1.004.png

Pythonで学ぶ統計思考(パート2)

仮説検定

  • 仮説が正しいと仮定したとき、観測データの妥当性を評価する
Pythonで学ぶ統計思考(パート2)

帰無仮説

  • 検定対象の仮説の別名
Pythonで学ぶ統計思考(パート2)

スイングステートの選挙結果のECDF

ch3-1.009.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

オバマ得票率(%)

ch3-1.011.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

仮説のシミュレーション

ch3-1.013.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

仮説のシミュレーション

ch3-1.015.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

仮説のシミュレーション

ch3-1.017.png

1 Data.gov(https://www.data.gov/)より取得
Pythonで学ぶ統計思考(パート2)

仮説のシミュレーション

ch3-1.019.png

Pythonで学ぶ統計思考(パート2)

置換(Permutation)

  • 配列内の要素をランダムに並べ替える
Pythonで学ぶ統計思考(パート2)

置換サンプルの生成

import numpy as np
dem_share_both = np.concatenate(
                       (dem_share_PA, dem_share_OH))

dem_share_perm = np.random.permutation(dem_share_both)
perm_sample_PA = dem_share_perm[:len(dem_share_PA)] perm_sample_OH = dem_share_perm[len(dem_share_PA):]
Pythonで学ぶ統計思考(パート2)

演習に進みましょう!

Pythonで学ぶ統計思考(パート2)

Preparing Video For Download...