Perl Math::CDF Module

A Perl module used to find probability quantiles and probabilities for several statistical distributions. Functions are available for 7 continuous distributions

  1. Beta
  2. Chi-square
  3. F
  4. Gamma
  5. Normal
  6. Poisson
  7. T-distribution

and for two discrete distributions

  1. Binomial
  2. Negative Binomial

Optional non-centrality parameters are available for the Chi-square, F and T-distributions. Cumulative probabilities are available for all 9 distributions and quantile functions are available for the 7 continuous distributions.

I didn't do the real work here, the algorithms are not mine but came from DCDFLIB. My contribution was just to provide a Perl wrapper for their algorithms.

Download Math-CDF-0.1.tar.gz and compile using:

	perl Makefile.PL
	make
	make test
	make install

or for Windows users use ppm:

	c:\> ppm
	ppm> rep add "edcallahan" http://edcallahan.com/ppm
	ppm> install Math-CDF
	ppm> rep del edcallahan
	ppm> quit

or for other users try

	[root@scar] perl -MCPAN -e shell;
	cpan> test Math::CDF
	cpan> install Math::CDF
	cpan> q

If you want to compile from source for Windows you'll need the Microsoft Visual C++ 6 compiler. (This seems to be the preferred compiler for ActiveState Perl distributions at least. I had no luck compiling with .Net 1, 1.1 or 2.0.) Edit the cdflib/Makefile.PL and change

	libcdflib$(LIB_EXT): $(O_FILES)
		$(AR) cr libcdflib$(LIB_EXT) $(O_FILES)
		$(RANLIB) libcdflib$(LIB_EXT)

to

	libcdflib$(LIB_EXT): $(O_FILES)
		$(AR) /OUT:libcdflib$(LIB_EXT) $(O_FILES)
		$(RANLIB) libcdflib$(LIB_EXT)

and compile with

	perl Makefile.PL
	nmake
	nmake test
	nmake install

Detailed documentation can be found here.