पेयर बूटस्ट्रैप

Statistical Thinking in Python (Part 2)

Justin Bois

Lecturer at the California Institute of Technology

नॉनपैरामेट्रिक इनफ़रेंस

  • डेटा के पीछे मौजूद मॉडल या प्रायिकता वितरण के बारे में कोई मान्यताएँ न मानें
Statistical Thinking in Python (Part 2)

2008 US स्विंग स्टेट चुनाव नतीजे

ch2-3.004.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 2)

लिनियर रिग्रेशन के लिए पेयर्स बूटस्ट्रैप

  • डेटा को पेयर्स में फिर से सैंपल करें
  • रिसैंपल्ड डेटा से स्लोप और इंटरसेप्ट निकालें
  • हर स्लोप और इंटरसेप्ट एक बूटस्ट्रैप रेप्लिकेट है
  • बूटस्ट्रैप रेप्लिकेट्स के पर्सेंटाइल से कॉन्फिडेंस इंटरवल निकालें
Statistical Thinking in Python (Part 2)

पेयर बूटस्ट्रैप सैंपल बनाना

np.arange(7)
array([0, 1, 2, 3, 4, 5, 6])
inds = np.arange(len(total_votes))

bs_inds = np.random.choice(inds, len(inds))
bs_total_votes = total_votes[bs_inds] bs_dem_share = dem_share[bs_inds]
Statistical Thinking in Python (Part 2)

पेयर बूटस्ट्रैप रेप्लिकेट निकालना

bs_slope, bs_intercept = np.polyfit(bs_total_votes, 
                                    bs_dem_share, 1)

bs_slope, bs_intercept
(3.9053605692223672e-05, 40.387910131803025)
np.polyfit(total_votes, dem_share, 1)  # fit of original
array([  4.03707170e-05,   4.01139120e+01])
Statistical Thinking in Python (Part 2)

2008 US स्विंग स्टेट चुनाव नतीजे

ch2-3.022.png

1 Data retrieved from Data.gov (https://www.data.gov/)
Statistical Thinking in Python (Part 2)

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

Statistical Thinking in Python (Part 2)

Preparing Video For Download...