Bootstrapping vs. Normalverteilung
Du hast bereits das Ergebnis eines Bootstrap-Konfidenzintervalls für Pearsons R gesehen. Aber wie ist es in typischen Situationen, etwa beim Konstruieren eines Konfidenzintervalls für einen Mittelwert? Warum würdest du ein Bootstrap-Konfidenzintervall einem „normalen“ Konfidenzintervall aus stats.norm vorziehen?
Ein DataFrame mit Investitionen von Venture-Capital-Firmen (investments_df) ist bereits für dich geladen, ebenso die Pakete pandas als pd, NumPy als np und stats aus SciPy.
Diese Übung ist Teil des Kurses
<Kurs>Grundlagen der Inferenz in Python</Kurs>Interaktive praktische Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Select just the companies in the Analytics market
analytics_df = ____[____ == 'Analytics']
# Confidence interval using the stats.norm function
norm_ci = stats.norm.____(alpha=____,
loc=____,
scale=____.std() / np.___(____))
# Construct a bootstrapped confidence interval
bootstrap_ci = stats.bootstrap(data=(____, ),
statistic=np.____)
print('Normal CI:', norm_ci)
print('Bootstrap CI:', bootstrap_ci.confidence_interval)