Permutation tests

Python में अनुमान का आधार

Paul Savala

Assistant Professor of Mathematics

Permutation tests

दो समूह, छोटे पुतलों के, अलग-अलग रंगों के साथ अलग रखे हुए.

Python में अनुमान का आधार

Permutation tests

  • सैंपल शफल करता है
  • परिणाम देखता है
  • देखा गया अंतर रैंडम जैसा लगता है?

छोटे पुतले एक-दूसरे से बदले जा रहे हैं.

Python में अनुमान का आधार

SciPy में permutation tests

new_satisfaction = [94, 85, 79, 91, 82]
old_satisfcation = [90, 87, 77, 85, 82]

# Group together our data data = (new_satisfaction, old_satisfcation)
# Define our test statistic def statistic(x, y): return np.mean(x) - np.mean(y)
# Compute a permutation test for the difference in means stats.permutation_test(data, statistic, n_resamples=1000, vectorized=False, alternative='greater')
Python में अनुमान का आधार

Correlation के लिए permutation tests

एक रेखा ग्राफ जिसमें लाल और नीली रेखा हैं. रेखाएँ हल्की-सी सहसम्बद्ध हैं.

stats.pearsonr(red_data, blue_data)[0]
0.08
Python में अनुमान का आधार

Correlation के लिए permutation tests

data = (red_data, blue_data)

def statistic(x, y): return stats.pearsonr(x, y)[0]
res = stats.permutation_test(data, statistic, n_resamples=1000, vectorized=False, alternative='two-sided')
print(res.pvalue < 0.05)
False
Python में अनुमान का आधार

Permutation tests

 

  • डेटा को रैंडम तरीके से shuffling कर null distribution बनाते हैं
  • किसी परिणाम की significance जाँचते हैं

Bootstrapping

 

  • डेटा को रैंडम तरीके से sampling कर probability distribution बनाते हैं
  • एक confidence interval बनाता है जो most likely outcomes दिखाता है
Python में अनुमान का आधार

अभ्यास करते हैं!

Python में अनुमान का आधार

Preparing Video For Download...