Example #1
0
    def testMakePmfFromCdf(self):
        t = [1, 2, 2, 3, 5]
        pmf = _04_Pmf._make_pmf_from_list(t)
        self.checkPmf(pmf)

        cdf = _13_Cdf._make_cdf_from_pmf(pmf)
        pmf2 = _04_Pmf._make_pmf_from_cdf(cdf)
        self.checkPmf(pmf2)
Example #2
0
def _make_normal_pmf(low=-spread, high=spread, digits=2):
    """
    Returns a Pmf object with the standard normal CDF.

    Args:
        low:    how many standard deviations below the mean?
        high:   how many standard deviations above the mean?
        digits:
    """
    cdf = _make_normal_cdf(low, high, digits)
    pmf = _04_Pmf._make_pmf_from_cdf(cdf)
    return pmf