I use various continuous distributions from scipy.stats (e.g. norms). Therefore, if I want to find P (Z <0.5), I would do:
from scipy.stats import norm norm(0, 1).cdf(0.5)
Is there a tool (scipy.stats or statsmodels or else) that I can use to describe the discrete distribution, and then calculate CDF / CMF, etc. On him? I can write the code myself, but I was wondering if something exists, for example:
pdf (x) = 1/3 for x = 1,2,3; else 0
Then I can build 2 vectors x = [1,2,3], p = [1/3, 1/3, 1/3] and introduce them into the library class, which will then provide .cdf (), etc.
source share