Continue verdelingen

Introductie tot statistiek in Python

Maggie Matsui

Content Developer, DataCamp

Wachten op de bus

tijdlijn van 13:00 tot 14:00 met 6 busaankomsten, elke 12 min

Introductie tot statistiek in Python

Continue uniforme verdeling

Assenstelsel met wachttijd op de x-as

Introductie tot statistiek in Python

Continue uniforme verdeling

Y-as wordt P(uitkomst = wachttijd) met een horizontale lijn op 1/12

Introductie tot statistiek in Python

Kans blijft = oppervlakte

$$P(4 \le \text{wait time} \le 7) = ~~ ?$$

Gebied tussen 4 en 7 gemarkeerd onder de horizontale lijn

Introductie tot statistiek in Python

Kans blijft = oppervlakte

$$P(4 \le \text{wait time} \le 7) = ~~ ?$$

Breedte van gemarkeerd gebied is 7-4=3, hoogte is 1/12

Introductie tot statistiek in Python

Kans blijft = oppervlakte

$$P(4 \le \text{wait time} \le 7) = 3 \times 1/12 = 3/12$$

Breedte van gemarkeerd gebied is 7-4=3, hoogte is 1/12

Introductie tot statistiek in Python

Uniforme verdeling in Python

$$ P(\text{wait time} \le 7)$$

Gebied gemarkeerd van 0 tot 7 onder horizontale lijn

from scipy.stats import uniform

uniform.cdf(7, 0, 12)
0.5833333
Introductie tot statistiek in Python

"Groter dan"-kansen

$$ P(\text{wait time} \ge 7) = 1 - P(\text{wait time} \le 7)$$

Gebied gemarkeerd van 7 tot 12

from scipy.stats import uniform
1 - uniform.cdf(7, 0, 12)
0.4166667
Introductie tot statistiek in Python

$$ P(4 \le \text{wait time} \le 7)$$

Gebied gemarkeerd van 4 tot 7

Introductie tot statistiek in Python

$$ P(4 \le \text{wait time} \le 7)$$

Gebied gemarkeerd van 0 tot 7

Introductie tot statistiek in Python

$$ P(4 \le \text{wait time} \le 7)$$

Gebied 0-4 licht gemarkeerd, gebied 4-7 donkerder gemarkeerd

from scipy.stats import uniform
uniform.cdf(7, 0, 12) - uniform.cdf(4, 0, 12)
0.25
Introductie tot statistiek in Python

Totale oppervlakte = 1

$$P(0 \le \text{wait time} \le 12) = ~~ ?$$

Breedte van de verdeling = 1, hoogte = 1/12

Introductie tot statistiek in Python

Totale oppervlakte = 1

$$P(0 \le \text{outcome} \le 12) = 12 \times 1/12 = 1$$

Breedte van de verdeling = 1, hoogte = 1/12

Introductie tot statistiek in Python

Willekeurige getallen genereren volgens uniforme verdeling

from scipy.stats import uniform
uniform.rvs(0, 5, size=10)
array([1.89740094, 4.70673196, 0.33224683, 1.0137103 , 2.31641255,
       3.49969897, 0.29688598, 0.92057234, 4.71086658, 1.56815855])
Introductie tot statistiek in Python

Andere continue verdelingen

 

Verdeling met 2 pieken

 

klokvormige verdeling

Introductie tot statistiek in Python

Andere continue verdelingen

 

Gemarkeerde oppervlakte onder curve met tekst: oppervlakte = 1

 

Gemarkeerde oppervlakte onder klokcurve met tekst: oppervlakte = 1

Introductie tot statistiek in Python

Andere speciale typen verdelingen

Normale verdeling

Plot van normale verdeling

Exponentiële verdeling

Plot van exponentiële verdeling

Introductie tot statistiek in Python

Laten we oefenen!

Introductie tot statistiek in Python

Preparing Video For Download...