Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the pmf's of discrete distributions symbolic #5

Open
pelegm opened this issue Oct 19, 2014 · 0 comments
Open

Make the pmf's of discrete distributions symbolic #5

pelegm opened this issue Oct 19, 2014 · 0 comments

Comments

@pelegm
Copy link
Owner

pelegm commented Oct 19, 2014

For example, make the pmf of the binomial distribution be something like

def pmf(self, k):
    n, p = self.n, self.p
    return choose(n, k) * p ** k * (1 - p) ** (n - k)

A few things to note:

  1. The choose function is called binomial in SymPy
  2. We may need to sympify k before putting it inside the calculation (not sure, we may wish to verify this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant