In [17]:
import pacal as pc
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
In [7]:
x = pc.BetaDistr(alpha=2, beta=5)
y = pc.BetaDistr(alpha=10, beta=2)
In [21]:
z = x * y
z.plot()
In [22]:
zcdf = z.get_piecewise_cdf_interp()
zcdf.plot()
In [23]:
samps = z.rand_invcdf(n=1000)
In [24]:
sns.kdeplot(samps)
Out[24]:
<matplotlib.axes.AxesSubplot at 0x1818e630>


Comments

comments powered by Disqus