शुरू करेंमुफ़्त में शुरू करें

Heritability मापना

याद रखें, Pearson correlation coefficient दो डेटा सेट्स की variances के geometric mean पर covariance का अनुपात होता है। यह पैरेंट्स और ऑफ़स्प्रिंग के बीच सहसंबंध का माप है, लेकिन हेरिटेबिलिटी का सबसे अच्छा अनुमान नहीं हो सकता। थोड़ा ठहरकर सोचें तो हेरिटेबिलिटी को पैरेंट और ऑफ़स्प्रिंग के बीच covariance को केवल पैरेंट्स की variance से भाग देकर परिभाषित करना अधिक तार्किक है। इस अभ्यास में, आप हेरिटेबिलिटी का अनुमान लगाएंगे और 95% confidence interval पाने के लिए pairs bootstrap कैलकुलेशन करेंगे।

यह अभ्यास एक बहुत महत्वपूर्ण बिंदु दिखाता है। Statistical inference (और सामान्य तौर पर data analysis) कोई प्लग-एंड-प्ले प्रक्रिया नहीं है। आपको यह स्पष्ट रूप से सोचना होता है कि अपने डेटा से आप किन सवालों के जवाब ढूँढना चाहते हैं, और उसी अनुसार विश्लेषण करना होता है। यदि आपका ध्यान इस बात पर है कि traits कितने विरासत में मिलते हैं, तो हमारी परिभाषित की गई quantity, यानी heritability, शेल्फ पर उपलब्ध आँकड़े Pearson correlation coefficient की तुलना में अधिक उपयुक्त है।

ध्यान रखें, डेटा bd_parent_scandens, bd_offspring_scandens, bd_parent_fortis, और bd_offspring_fortis में संग्रहित है.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Statistical Thinking in Python (Part 2)

पाठ्यक्रम देखें

अभ्यास निर्देश

  • एक फंक्शन heritability(parents, offspring) लिखें, जो हेरिटेबिलिटी compute करे, जिसे पैरेंट्स और ऑफ़स्प्रिंग में ट्रेट की covariance को केवल पैरेंट्स में उसी ट्रेट की variance से भाग देकर परिभाषित किया गया है। संकेत: इस कोर्स के पहले भाग में कवर किए गए np.cov() फंक्शन को याद कर लीजिए।
  • इस फंक्शन का उपयोग करके G. scandens और G. fortis के लिए हेरिटेबिलिटी compute करें।
  • G. scandens और G. fortis के लिए pairs bootstrap का उपयोग करके हेरिटेबिलिटी के 1000 bootstrap replicates प्राप्त करें।
  • अपने bootstrap replicates का उपयोग करके दोनों के लिए 95% confidence interval compute करें।
  • परिणाम प्रिंट करें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

def heritability(parents, offspring):
    """Compute the heritability from parent and offspring samples."""
    covariance_matrix = np.cov(parents, offspring)
    return ____ / ____

# Compute the heritability
heritability_scandens = ____
heritability_fortis = ____

# Acquire 1000 bootstrap replicates of heritability
replicates_scandens = draw_bs_pairs(
        ____, ____, ____, size=____)
        
replicates_fortis = draw_bs_pairs(
        ____, ____, ____, size=____)


# Compute 95% confidence intervals
conf_int_scandens = ____
conf_int_fortis = ____

# Print results
print('G. scandens:', heritability_scandens, conf_int_scandens)
print('G. fortis:', heritability_fortis, conf_int_fortis)
कोड संपादित करें और चलाएँ