क्या mean variance के बराबर है?
Poisson मॉडल में एक धारणा यह थी कि mean और variance समान होने चाहिए. जैसा आपने लेक्चर में सीखा, अगर यह धारणा टूटती है तो overdispersion होती है. Overdispersion का समायोजन किए बिना, आप दिए गए मॉडल के standard errors की गलत व्याख्या करेंगे.
इस अभ्यास में आप पहले मादा केकड़ों के लिए satellites की संख्या का mean और variance निकालेंगे.
crab डेटासेट आपके वर्कस्पेस में लोड है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Generalized Linear Models
अभ्यास निर्देश
numpyकीmean()का उपयोग करके satellites वैरिएबलsatका sample mean निकालें औरsat_meanके रूप में प्रिंट करें.numpyकीvar()का उपयोग करके satellites वैरिएबलsatका sample variance निकालें औरsat_varके रूप में प्रिंट करें.sat_varकाsat_meanसे अनुपात निकालें और प्रिंट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Compute and print sample mean of the number of satellites: sat_mean
____ = np.____(____.____)
print('Sample mean:', round(____, 3))
# Compute and print sample variance of the number of satellites: sat_var
____ = np.____(____.____)
print('Sample variance:', round(____, 3))
# Compute ratio of variance to mean
print('Ratio:', round(____/____, 3))