Test::Probability - test if results are distributed correctly
use Test::Probability; my @results; for (0 .. 1000) { $results[rand_fn()]++; } my @probabilities = (0.5, 0.2, 0.3); my $confidence = 0.9; dist_ok(@results, @probabilities, $confidence, "results match expected with confidence $confidence");
Does your random-number generating function output the distribution you expect? Now you can find out! This module performs a chi-squared test at the specified confidence interval.
dist_ok(@results, @probabilities, $confidence, "results match probabilities with confidence $confidence");
Miles Gould, <mgould@cpan.org>
This module is currently distributed along with Games::Dice::Loaded. Please fork the GitHub repository.
Copyright (C) 2011 by Miles Gould
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.4 or, at your option, any later version of Perl 5 you may have available.
To install Games::Dice::Loaded, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Dice::Loaded
CPAN shell
perl -MCPAN -e shell install Games::Dice::Loaded
For more information on module installation, please visit the detailed CPAN module installation guide.