बूटस्ट्रैप कॉन्फिडेंस इंटरवल्स

Statistical Thinking in Python (Part 2)

Justin Bois

Lecturer at the California Institute of Technology

बूटस्ट्रैप रिप्लिकेट फंक्शन

def bootstrap_replicate_1d(data, func):
    """Generate bootstrap replicate of 1D data."""
    bs_sample = np.random.choice(data, len(data))
    return func(bs_sample)

bootstrap_replicate_1d(michelson_speed_of_light, np.mean)
299859.20000000001
bootstrap_replicate_1d(michelson_speed_of_light, np.mean)
299855.70000000001
bootstrap_replicate_1d(michelson_speed_of_light, np.mean)
299850.29999999999
Statistical Thinking in Python (Part 2)

कई बूटस्ट्रैप रिप्लिकेट्स

bs_replicates = np.empty(10000)

for i in range(10000): bs_replicates[i] = bootstrap_replicate_1d( michelson_speed_of_light, np.mean)
Statistical Thinking in Python (Part 2)

बूटस्ट्रैप रिप्लिकेट्स का हिस्टोग्राम प्लॉट करना

_ = plt.hist(bs_replicates, bins=30, density=True)
_ = plt.xlabel('mean speed of light (km/s)')
_ = plt.ylabel('PDF')
plt.show()
Statistical Thinking in Python (Part 2)

मीन का बूटस्ट्रैप अनुमान

ch2-2.011.png

Statistical Thinking in Python (Part 2)

किसी सांख्यिकीय मान का कॉन्फिडेंस इंटरवल

  • यदि हम मापों को बार-बार दोहराएँ, तो देखे गए मानों में से p% मान p% कॉन्फिडेंस इंटरवल के भीतर होंगे.
Statistical Thinking in Python (Part 2)

बूटस्ट्रैप कॉन्फिडेंस इंटरवल

conf_int = np.percentile(bs_replicates, [2.5, 97.5])
array([ 299837.,  299868.])

ch2-2.016.png

Statistical Thinking in Python (Part 2)

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

Statistical Thinking in Python (Part 2)

Preparing Video For Download...