-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add SqrtBeta probability distribution #430
Conversation
I added the PDF and CDF. However, I could not think of a good way to test them (in a unit test) so far. |
18617ed
to
621a780
Compare
I have a commit 967706a in another branch that does the mean and variance of UniformHypersphere components. For this branch, something like this seems good to have, but I'm not sure if we want it as a separate distribution. Users won't be using it to distribute their parameters. Maybe we want it under the UniformHypersphere class (i.e., add pdf, mean, and variance attributes kind of like I've done in 967706a). |
I'm not sure if I get what you are saying. Do you propose to add a mean and a variance function to |
Take a look at my commit. The whole point of having the SqrtBeta class is that this is the distribution of one element of the UniformHypersphere class, right? I.e. it's the marginal distribution of UniformHypersphere. So why not put it there? When people use it, they will always be using it in the context of UniformHypersphere, to get the distribution of one element. It will never be used as its own stand-alone distribution. |
|
In 967706a I use the SqrtBeta distribution to calculate the mean and variance for any one dimension of the points from a UniformHypersphere distribution. Setting |
If you use it by itself, then that's fine. Probably my code should be using yours, then, but I didn't want the Scipy dependency. Also, once I did it numerically I found that there are analytic forms for the mean and variance of an element of UniformHypersphere, so we can just use those. |
The reason that you don't need Scipy is that you are skipping the normalization. Though, it shouldn't be too complicated to write our own approximations for One thing I like more about my implementation is that the dimensions are passed to the constructor and I do not have to repeat them every time. |
I think this is good to go. It's just adding a distribution, so it should be straightforward (i.e. it can't break anything). |
Also added SubvectorLength distribution based off the SqrtBeta distribution.
This addresses #414.
I uploaded the derivation of the probability distribution to the Google drive.
I am unsure whether to add the PDF/CDF. I think, those are useful, but we're not providing those functions for the other probability distributions.