{"id":20202954,"url":"https://github.com/shawnlaffan/perl-statistics-sampler-multinomial","last_synced_at":"2025-07-26T13:02:23.958Z","repository":{"id":56837868,"uuid":"77674475","full_name":"shawnlaffan/perl-statistics-sampler-multinomial","owner":"shawnlaffan","description":"Multinomial sampler for Perl","archived":false,"fork":false,"pushed_at":"2022-09-24T09:56:49.000Z","size":150,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T20:30:29.847Z","etag":null,"topics":["hacktoberfest","multinomial","perl","prng","statistics"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shawnlaffan.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-30T08:56:16.000Z","updated_at":"2022-09-24T09:48:37.000Z","dependencies_parsed_at":"2022-09-12T11:51:10.357Z","dependency_job_id":null,"html_url":"https://github.com/shawnlaffan/perl-statistics-sampler-multinomial","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnlaffan%2Fperl-statistics-sampler-multinomial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnlaffan%2Fperl-statistics-sampler-multinomial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnlaffan%2Fperl-statistics-sampler-multinomial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shawnlaffan%2Fperl-statistics-sampler-multinomial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shawnlaffan","download_url":"https://codeload.github.com/shawnlaffan/perl-statistics-sampler-multinomial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241637589,"owners_count":19995002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","multinomial","perl","prng","statistics"],"created_at":"2024-11-14T04:58:56.748Z","updated_at":"2025-03-03T09:20:44.349Z","avatar_url":"https://github.com/shawnlaffan.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# perl-statistics-sampler-multinomial\n\n\nImplements multinomial sampling using two methods, the\nconditional binomial method, and Vose's version of the alias method\n(as a separate package).\n\nThe setup time for the alias method is longer than for other methods,\nand the memory requirements are larger since it maintains two lists in memory,\nbut this is amortised when \nwhen generating repeated samples because only two random numbers are\nneeded for each draw, as compared to up to O(log n) for other methods.\nThis should have a pay off when, for example calculating \nbootstrap confidence intervals for a set of classes.\n\nHowever, benchmarking indicates that the conditional binomial code is\nsubstantially (approximately four times) faster than the alias method code\nwhen using the Mersenne Twister implemented in Math::Random::MT::Auto.\nProfiling using Devel::NYTProf indicates this is probably due to\nPerl level overheads for the PRNG method calls in the Alias code.\nFor the conditional binomial code most of the PRNG calls are\nat the C level inside XS code.\n\nBenchmarking also indicates that the Math::GSL::Randist implementation\nis a few orders of magnitude faster still, so if you aren't worried about\nusing your own PRNG, and can install Math::GSL::Randist,\nthen you should consider using that.\nThe Math::Random implementation is also faster than this module,\nbut not as fast as the GSL.\n\nSo if it is not faster, then why would you use this module?\nThe main reason is that it allows you to pass your own\nPRNG object, and thus you can continue sampling from an existing PRNG stream\nwithin your analysis using the PRNG of your choice.\nThis simplifies reproducibility of results as one only\nneeds to store the starting state for one PRNG, not several.\n\n\nFor more details and background about multinomial sampling,\nsee http://www.keithschwarz.com/darts-dice-coins\n\n\n## COPYRIGHT AND LICENCE\n\nCopyright (C) 2016, Shawn Laffan\n\nThis library is free software; you can redistribute it and/or modify\nit under the same terms as Perl itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnlaffan%2Fperl-statistics-sampler-multinomial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshawnlaffan%2Fperl-statistics-sampler-multinomial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshawnlaffan%2Fperl-statistics-sampler-multinomial/lists"}