|
Methods defined here:
- Append(self, x, p)
- Add an (x, p) pair to the end of this CDF.
Note: this us normally used to build a CDF from scratch, not
to modify existing CDFs. It is up to the caller to make sure
that the result is a legal CDF.
- Items(self)
- Returns a sorted sequence of (value, probability) pairs.
Note: in Python3, returns an iterator.
- Mean(self)
- Computes the mean of a CDF.
Returns:
float mean
- Percentile(self, p)
- Returns the value that corresponds to percentile p.
Args:
p: number in the range [0, 100]
Returns:
number value
- Prob(self, x)
- Returns CDF(x), the probability that corresponds to value x.
Args:
x: number
Returns:
float probability
- Random(self)
- Chooses a random value from this distribution.
- Render(self)
- Generates a sequence of points suitable for plotting.
An empirical CDF is a step function; linear interpolation
can be misleading.
Returns:
tuple of (xs, ps)
- Sample(self, n)
- Generates a random sample from this distribution.
Args:
n: int length of the sample
- Value(self, p)
- Returns InverseCDF(p), the value that corresponds to probability p.
Args:
p: number in the range [0, 1]
Returns:
number value
- Values(self)
- Returns a sorted list of values.
- __init__(self, xs=None, ps=None, name='')
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|