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

Don't quite understand the polya urn model code #3

Open
Beronx86 opened this issue Apr 3, 2016 · 0 comments
Open

Don't quite understand the polya urn model code #3

Beronx86 opened this issue Apr 3, 2016 · 0 comments

Comments

@Beronx86
Copy link

Beronx86 commented Apr 3, 2016

In the wiki, the colors of the balls in the urn are predefined and no new color is added in the procress. But in the code, new color is added to the urn under some circumstance. And the new color is sampled from G_0. However the G_0 in the code is not a distribution (not sum to 1).
When adding a new color, the code sample a new color by running unit_uniform = lambda { (rand * 100).to_i / 100.0 }. The ratio is used as the identifer of the color. What is the relationship between the ratios?

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