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

Documentation for Distribution.support() lacking #937

Closed
ab-10 opened this issue Dec 8, 2020 · 2 comments
Closed

Documentation for Distribution.support() lacking #937

ab-10 opened this issue Dec 8, 2020 · 2 comments

Comments

@ab-10
Copy link

ab-10 commented Dec 8, 2020

Looking at the documentation I'm unable to understand for what distributions is support() defined.

For example the following works:

var b = Bernoulli({p: 0.5})
print("Possible values sampled from Bernoulli: " + b.support())

>>> Possible values sampled from Bernoulli: true,false

whereas the same on Gaussian distribution fails:

var g = Gaussian({mu: 5, sigma: 4})
print("Possible values sampled from Gaussian: " + g.support())
>>> g.support is not a function
@null-a
Copy link
Member

null-a commented Dec 8, 2020

My recollection is that we use support in two main ways:

  1. Distributions with finite support always have a support method that returns an array containing all elements over which the distribution is defined.
  2. Distributions that have support over a bounded subset of the real line use support to indicate lower and/or upper bounds.

Other distributions (e.g. those with countable support, support over entire real line, multivariate distributions) likely don't implement the method.

Yes, this isn't documented, in-part because it's not clear this is part of the public API I think. I'll close this as a duplicate of #894, but happy to try to answer further questions if you have them.

@null-a null-a closed this as completed Dec 8, 2020
@ab-10
Copy link
Author

ab-10 commented Dec 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants