TODO
Official documentation:
In [ ]:
    
%matplotlib inline
    
In [ ]:
    
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
    
In [ ]:
    
n = 20
p = 0.25
dist = scipy.stats.binom(n, p)
    
In [ ]:
    
xmin = 0
xmax = n
x = np.arange(xmin, xmax, 1)
y = dist.pmf(x)
plt.plot(x, y, 'k.');
    
In [ ]:
    
xmin = 0
xmax = n + 1
x = np.arange(xmin, xmax, 1)
xstart = x[:-1]
xend = x[1:]
y = dist.cdf(xstart)
plt.hlines(y, xstart, xend, colors='k')
plt.plot(xstart, y, 'k.');
    
In [ ]:
    
k = 3
dist = scipy.stats.poisson(k)
    
In [ ]:
    
xmin = 0
xmax = 14 + 1  # TODO
x = np.arange(xmin, xmax, 1)
y = dist.pmf(x)
plt.plot(x, y, 'k.');
    
In [ ]:
    
xmin = 0
xmax = 14 + 2 # TODO
x = np.arange(xmin, xmax, 1)
xstart = x[:-1]
xend = x[1:]
y = dist.cdf(xstart)
plt.hlines(y, xstart, xend, colors='k')
plt.plot(xstart, y, 'k.');
    
In [ ]:
    
mu = 0.
sigma = 1.
dist = scipy.stats.norm(mu, sigma)
    
In [ ]:
    
xmin = -5.
xmax = 5.
x = np.arange(xmin, xmax, 0.01)
y = dist.pdf(x)
plt.plot(x, y, 'k-');
    
In [ ]:
    
xmin = -5.
xmax = 5.
x = np.arange(xmin, xmax, 0.01)
y = dist.cdf(x)
plt.plot(x, y, 'k-');