#!/usr/bin/env python # coding: utf-8 # # [Goulib](../notebook.ipynb).stats # very basic statistics functions # In[1]: from Goulib.notebook import * from Goulib.stats import * # ## Discrete distributions # In[2]: dice=Discrete(range(1,6+1)) dice # In[3]: Y=Discrete({1:0.2, -1:0.8}) Y # In[9]: X=Discrete({-2:0.15,-1:.2,0:.3,1:.2,2:.15}) X**2+Y # ## Normal distribution # In[5]: n1=Normal() print(n1) n1 # In[6]: n2=Normal([],4,4) n2 # In[7]: n1+n2 # In[8]: plot.plot([n1,n2,n1+n2])