Foundations of Probability in Python - Part 3
Foundations of Probability in Python - Part 3
F O U N D AT I O N S O F P R O B A B I L I T Y I N P Y T H O N
Alexander A. Ramírez M.
CEO @ Synergy Vision
Modeling for measures
Alexander A. Ramírez M.
CEO @ Synergy Vision
Probability density
In Python this can be done in a couple of
lines:
# Import norm
from scipy.stats import norm
0.24197072451914337
0.15865525393145707 0.6914624612740131
-0.8416212335729142 0.12566134685507416
0.5 0
0.6826894921370859
0.15865525393145707
0.04550026389635839
0.04550026389635839
(-1.959963984540054, 1.959963984540054)
Alexander A. Ramírez M.
CEO @ Synergy Vision
Poisson modeling
# Import poisson
from scipy.stats import poisson
0.19663867170702193
0.11080315836233387 0.01744840480280308
0.6227137499963162 0.9750902496952996
0.3772862500036838 2.0
Alexander A. Ramírez M.
CEO @ Synergy Vision
Geometric modeling
Model for a basketball player with probability We can model a grizzly bear that has a 0.033
0.3 of scoring. probability of catching a salmon.
# Import geom
from scipy.stats import geom
0.02455102908739612
# Calculate cdf of 4
geom.cdf(k=4, p=0.3)
0.7598999999999999
# Calculate sf of 2
geom.sf(k=2, p=0.3)
0.49000000000000005
3.0