Générer des répliques bootstrap

Réflexion statistique en Python (partie 2)

Justin Bois

Lecturer at the California Institute of Technology

Mesures de la vitesse de la lumière de Michelson

ch2-1.002.png

1 Data : Michelson, 1880
Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.004.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.005.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.006.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.007.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.008.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.009.png

Réflexion statistique en Python (partie 2)

Rééchantillonner un tableau

ch2-1.010.png

Réflexion statistique en Python (partie 2)

Moyenne des mesures rééchantillonnées de Michelson

ch2-1.011.png

Réflexion statistique en Python (partie 2)

Bootstrap

  • Utiliser des données rééchantillonnées pour faire de l'inférence statistique
Réflexion statistique en Python (partie 2)

Échantillon bootstrap

  • Un tableau rééchantillonné des données
Réflexion statistique en Python (partie 2)

Réplique bootstrap

  • Une statistique calculée à partir d'un tableau rééchantillonné
Réflexion statistique en Python (partie 2)

Moteur de rééchantillonnage : np.random.choice()

import numpy as np
np.random.choice([1,2,3,4,5], size=5)
array([5, 3, 5, 5, 2])
Réflexion statistique en Python (partie 2)

Calculer une réplique bootstrap

bs_sample = np.random.choice(michelson_speed_of_light,
                             size=100)

np.mean(bs_sample)
299847.79999999999
np.median(bs_sample)
299845.0
np.std(bs_sample)
83.564286025729331
Réflexion statistique en Python (partie 2)

Passons à la pratique !

Réflexion statistique en Python (partie 2)

Preparing Video For Download...