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

uniform sampling from n-ball #2

Open
chengyh23 opened this issue Jul 18, 2022 · 1 comment
Open

uniform sampling from n-ball #2

chengyh23 opened this issue Jul 18, 2022 · 1 comment

Comments

@chengyh23
Copy link

double r = pow(uniform_rand_(gen_), 0.33333);

In infromed sampling, I‘m confused with uniform sampling from 3-ball

@chengyh23
Copy link
Author

chengyh23 commented Jul 18, 2022

As in Generate points uniformly inside a d-dimensional ball,

If Y is drawn from the uncorrelated multivariate normal distribution, then S = Y / ||Y|| has the uniform distribution on the unit d-sphere. Multiplying S by U^{1/d}, where U has the uniform distribution on the unit interval (0,1), creates the uniform distribution in the unit d-dimensional ball.

thus, normal sampling->vector normalization->multiply by a uniform sampled random number generates uniform sample from n-ball

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

1 participant