Skip to content

General PMF method #13

@pelegm

Description

@pelegm

A general PMF method for random variables should look as follows:

def indicator(self, k):
    """ Return the indicator function of X=k. """
    def ind(w, k=k, func=self.func):
        return 1 if func(w) == k else 0
    return ind

def pmf(self, k):
    return self.pspace.integrate(self.indicator(k))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions