SciPy.org API Documentation Generated by Endo, 2006-08-14

A generic discrete random variable.

Discrete random variables are defined from a standard form. The standard form may require some other parameters to complete its specification. The distribution methods also take an optional location parameter using loc= keyword. The default is loc=0. The calling form of the methods follow:

generic.rvs(<shape(s)>,loc=0)
  • random variates
generic.pmf(x,<shape(s)>,loc=0)
  • probability mass function
generic.cdf(x,<shape(s)>,loc=0)
  • cumulative density function
generic.sf(x,<shape(s)>,loc=0)
  • survival function (1-cdf --- sometimes more accurate)
generic.ppf(q,<shape(s)>,loc=0)
  • percent point function (inverse of cdf --- percentiles)
generic.isf(q,<shape(s)>,loc=0)
  • inverse survival function (inverse of sf)
generic.stats(<shape(s)>,loc=0,moments='mv')
  • mean('m'), variance('v'), skew('s'), and/or kurtosis('k')
generic.entropy(<shape(s)>,loc=0)
  • entropy of the RV
Alternatively, the object may be called (as a function) to fix
the shape and location parameters returning a "frozen" discrete RV object:
myrv = generic(<shape(s)>,loc=0)
  • frozen RV object with the same methods but holding the

    given shape and location fixed.

You can construct an aribtrary discrete rv where P{X=xk} = pk by passing to the rv_discrete initialization method (through the values= keyword) a tuple of sequences (xk,pk) which describes only those values of X (xk) that occur with nonzero probability (pk).

Method summary

Methods