Bootstrap hipotez testleri

Python ile İstatistiksel Düşünme (Bölüm 2)

Justin Bois

Lecturer at the California Institute of Technology

Hipotez testi iş akışı

  • Sıfır hipotezini açıkça belirt
  • Test istatistiğini tanımla
  • Sıfır hipotezi doğru kabul edilerek çok sayıda benzetim veri kümesi üret
  • Her benzetim veri kümesi için test istatistiğini hesapla
  • p-değeri, test istatistiğinin gerçek verideki kadar uç olduğu benzetimlerin oranıdır
Python ile İstatistiksel Düşünme (Bölüm 2)

Michelson ve Newcomb: ışık hızının öncüleri

ch3-3.008.png

1 Michelson görseli: kamu malı, Smithsonian 2 Newcomb görseli: US Library of Congress
Python ile İstatistiksel Düşünme (Bölüm 2)

Michelson ve Newcomb: ışık hızının öncüleri

ch3-3.010.png

1 Michelson görseli: kamu malı, Smithsonian 2 Newcomb görseli: US Library of Congress
Python ile İstatistiksel Düşünme (Bölüm 2)

Elimizdeki veriler

ch3-3.011.png

1 Veri: Michelson, 1880
Python ile İstatistiksel Düşünme (Bölüm 2)

Sıfır hipotezi

  • Michelson'ın deneylerindeki gerçek ortalama ışık hızı, aslında Newcomb'un bildirdiği değerdir
Python ile İstatistiksel Düşünme (Bölüm 2)

Michelson verisini kaydırma

newcomb_value = 299860  # km/s
michelson_shifted = michelson_speed_of_light \\
           - np.mean(michelson_speed_of_light) + newcomb_value

ch3-3.019.png

Python ile İstatistiksel Düşünme (Bölüm 2)

Test istatistiğini hesaplama

def diff_from_newcomb(data, newcomb_value=299860):
    return np.mean(data) - newcomb_value
diff_obs = diff_from_newcomb(michelson_speed_of_light)

diff_obs
-7.5999999999767169
Python ile İstatistiksel Düşünme (Bölüm 2)

p-değerini hesaplama

bs_replicates = draw_bs_reps(michelson_shifted,
                             diff_from_newcomb, 10000)

p_value = np.sum(bs_replicates <= diff_observed) / 10000
p_value
0.16039999999999999
Python ile İstatistiksel Düşünme (Bölüm 2)

 

Tek örneklem testi

- Bir veri kümesini tek bir sayıyla karşılaştır

 

İki örneklem testi

- İki veri kümesini karşılaştır
Python ile İstatistiksel Düşünme (Bölüm 2)

Hadi pratik yapalım!

Python ile İstatistiksel Düşünme (Bölüm 2)

Preparing Video For Download...