Numbers that are closer than this are considered equal
Return the entropy of the normalized distribution p.
Return the entropy of the normalized distribution p. The log is w.r.t. base 2.
Returns the Jensen-Shannon divergence.
Returns the KL divergence, K(p1 || p2).
Returns the KL divergence, K(p1 || p2). The log is w.r.t. base 2.
*Note*: If any value in p2 is 0.0 then the KL-divergence is infinite.
Computes p(x;n,p) where x~B(n,p)
Return a random double drawn from a Beta distribution with mean a/(a+b) and variance ab/((a+b+1)(a+b)^2).
Return a random BitSet with "size" bits, each having probability p of being true.
Return a random boolean, with probability p of being true.
Return a random boolean, equally likely to be true or false.
Return a random double drawn from an Chi-squared distribution with mean df+lambda and variance 2*df.
Return a random double drawn from an Chi-squared distribution with mean df and variance 2*df.
Return a random double drawn from an Chi-squarted distribution with mean 1 and variance 2.
Return a random double drawn from an Chi-squarted distribution with mean 1 and variance 2. Equivalent to nextChiSq(1)
draw a single sample from (unnormalized) multinomial "a", with normalizing factor "sum".
Draw a single sample from multinomial "a".
Draw a single sample from multinomial "a". Assumes that the elements of "a" already sum to 1.0.
Return a random double drawn from an Exponential distribution with mean beta+lambda and variance beta^2.
Return a random double drawn from an Exponential distribution with mean beta and variance beta^2.
Return a random double drawn from an Exponential distribution with mean 1 and variance 1.
Return a random double drawn from a Gamma distribution with mean alpha*beta+lamba and variance alpha*beta^2.
Return a random double drawn from a Gamma distribution with mean alpha*beta and variance alpha*beta^2.
Return a random double drawn from a Gamma distribution with mean alpha and variance 1.
Return a random double drawn from a Gamma distribution with mean alpha and variance 1.0.
Return a random double drawn from a Gamma distribution with mean 1.
Return a random double drawn from a Gamma distribution with mean 1.0 and variance 1.0.
Return a random double drawn from a Gaussian distribution with mean m and variance s2.
Return a random double drawn from a Gaussian distribution with mean 0 and variance 1.
Return nextPoisson(1).
Return random integer from Poission with parameter lambda.
Return random integer from Poission with parameter lambda. The mean of this distribution is lambda. The variance is lambda.
Return a random double in the range 0 to 1, inclusive, uniformly sampled from that range.
Return a random double in the range 0 to 1, inclusive, uniformly sampled from that range. The mean of this distribution is 0.5. The variance is 1/12.
Vastly inefficient O(x) method to compute cdf of B(n,p)
Returns the unbiased sample variance.
Returns the unbiased sample variance. See http://en.wikipedia.org/wiki/Variance#Population_variance_and_sample_variance
Returns the sum of two doubles expressed in log space, that is,
sumLogProb = log (e^a + e^b) = log e^a(1 + e^(b-a)) = a + log (1 + e^(b-a))
Returns the sum of two doubles expressed in log space, that is,
sumLogProb = log (e^a + e^b) = log e^a(1 + e^(b-a)) = a + log (1 + e^(b-a))
By exponentiating b-a, we obtain better numerical precision than we would if we calculated e^a or e^b directly.