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
Grundlagen der Inferenz in Python
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# 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)