JuliaLang/julia — pull request #637 by dmbates (2012-03-24 11:07:14+00:00)
Title: Rmath.jl providing Julia versions of the d-p-q-r functions from libRmath.so

This package (well, file actually) provides access to the d-p-q-r functions from the R math library. The names are created from prefixes d, p, q or r prepended to an abbreviated distribution name, such as "norm" or "binom".

A d function evaluates the probability density for a continuous distribution or the probability mass function (pmf) for a discrete distribution. The p functions evaluate the cumulative probability function, also called the cumulative distribution function or cdf. The q functions evaluate the quantile function which is the inverse of the cdf. The r functions provide a single random draw from the distribution.

The first argument of a d function is x, the abscissa, and the last argument is give_log indicating if the result should be the logarithm of the density or pmf. Intermediate arguments are the parameters of the distribution.

The first argument of a p function is q and of a q function is p. The last two arguments are left_tail (defaults to true) and log.p (defaults to false).

These functions are vectorized for the initial argument and for the arguments representing parameters.