List of usage examples for org.apache.commons.math.distribution AbstractContinuousDistribution density
public double density(double x) throws MathRuntimeException
From source file:org.renjin.Distributions.java
/** * Calculates the value of the density function at {@code x} * for the given continuous distribution * * @param dist the distribution of the random variable * @param x the value/* w w w.ja va2 s . c om*/ * @param log whether to return the natural logarithm of the function's value * @return the (natural logarithm) of the relative likelihood for the random * variable to take the value {@code x} */ private static double d(AbstractContinuousDistribution dist, double x, boolean log) { double d = dist.density(x); if (log) { d = Math.log(d); } return d; }