AbstractRealDistribution
org.apache.commons.math3.distribution

Class AbstractRealDistribution

    • Field Detail

      • SOLVER_DEFAULT_ABSOLUTE_ACCURACY

        public static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY
        Default accuracy.
        See Also:
        Constant Field Values
    • Method Detail

      • cumulativeProbability

        @Deprecatedpublic double cumulativeProbability(double x0,                                      double x1)                             throws NumberIsTooLargeException
        Deprecated. As of 3.1 (to be removed in 4.0). Please use probability(double,double) instead.
        For a random variable X whose values are distributed according to this distribution, this method returns P(x0 < X <= x1). The default implementation uses the identity

        P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)

        Specified by:
        cumulativeProbability in interface RealDistribution
        Parameters:
        x0 - the exclusive lower bound
        x1 - the inclusive upper bound
        Returns:
        the probability that a random variable with this distribution takes a value between x0 and x1, excluding the lower and including the upper endpoint
        Throws:
        NumberIsTooLargeException - if x0 > x1
      • probability

        public double probability(double x0,                 double x1)
        For a random variable X whose values are distributed according to this distribution, this method returns P(x0 < X <= x1).
        Parameters:
        x0 - Lower bound (excluded).
        x1 - Upper bound (included).
        Returns:
        the probability that a random variable with this distribution takes a value between x0 and x1, excluding the lower and including the upper endpoint.
        Throws:
        NumberIsTooLargeException - if x0 > x1. The default implementation uses the identity P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)
      • reseedRandomGenerator

        public void reseedRandomGenerator(long seed)
        Reseed the random generator used to generate samples.
        Specified by:
        reseedRandomGenerator in interface RealDistribution
        Parameters:
        seed - the new seed
      • sample

        public double sample()
        Generate a random value sampled from this distribution. The default implementation uses the inversion method.
        Specified by:
        sample in interface RealDistribution
        Returns:
        a random value.
      • sample

        public double[] sample(int sampleSize)
        Generate a random sample from the distribution. The default implementation generates the sample by calling sample() in a loop.
        Specified by:
        sample in interface RealDistribution
        Parameters:
        sampleSize - the number of random values to generate
        Returns:
        an array representing the random sample
      • probability

        public double probability(double x)
        For a random variable X whose values are distributed according to this distribution, this method returns P(X = x). In other words, this method represents the probability mass function (PMF) for the distribution.
        Specified by:
        probability in interface RealDistribution
        Parameters:
        x - the point at which the PMF is evaluated
        Returns:
        zero.
      • logDensity

        public double logDensity(double x)
        Returns the natural logarithm of the probability density function (PDF) of this distribution evaluated at the specified point x. In general, the PDF is the derivative of the CDF. If the derivative does not exist at x, then an appropriate replacement should be returned, e.g. Double.POSITIVE_INFINITY, Double.NaN, or the limit inferior or limit superior of the difference quotient. Note that due to the floating point precision and under/overflow issues, this method will for some distributions be more precise and faster than computing the logarithm of RealDistribution.density(double). The default implementation simply computes the logarithm of density(x).
        Parameters:
        x - the point at which the PDF is evaluated
        Returns:
        the logarithm of the value of the probability density function at point x

SCaVis 2.2 © jWork.ORG