I would like to calculate the Cumulative Density Function of a normal distribution in Perl. I am using the
Math::Gauss
module from CPAN which calculates a CDF without any problem.
ttt.pl
#!/usr/bin/perl
use strict;
use warnings;
use Math::Gauss ':all';
my $x = 0.1;
my $mean = 0;
my $std = 0.1;
my $output = cdf($x, $mean, $std);
print $output;
However, I got a module installation problem when I ran the code in a different server as below:
Can't locate Math/Gauss.pm in @INC (@INC contains:
/etc/perl
/usr/local/lib/perl/5.14.2
/usr/local/share/perl/5.14.2
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.14
/usr/share/perl/5.14
/usr/local/lib/site_perl
. ) at ./ttt.pl line 5.
BEGIN failed--compilation aborted at ./ttt.pl line 5.
I don't have a root authority so I need to install it locally, but I think CDF calculation is not a big calculation. (The CDF equation is simple.)
So it would be great if I knew the way to calculate a CDF in Perl without any installation. Or is there a way to include Math/Gauss.pm
in my code so I can use it without installation?