Class Bernoulli

  • All Implemented Interfaces:
    java.io.Serializable , jline.lang.Copyable

    
    public class Bernoulli
    extends DiscreteDistribution implements Serializable
                        

    A Bernoulli distribution for modeling binary random variables.

    The Bernoulli distribution models a single trial with two possible outcomes: success (1) with probability p, or failure (0) with probability (1-p). It's the fundamental building block for binomial processes and binary decision modeling.

    Key characteristics:

    • Support: {0, 1}
    • Parameter: p ∈ [0,1] (success probability)
    • Mean: p
    • Variance: p(1-p)
    • Special case of binomial distribution with n=1

    Common applications include modeling job completion states, server availability, and routing decisions in queueing networks.

    Since:

    1.0

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Bernoulli(double prob)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      double evalCDF(int t)
      double evalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.
      double evalPMF(int k)
      double evalLST(double s) Evaluates the Laplace-Stieltjes Transform at s.
      double getMean() Gets the mean (expected value) of this distribution.
      double getSCV() Gets the squared coefficient of variation (SCV) of this distribution.
      double getSkewness() Gets the skewness of this distribution.
      double getVar() Gets the variance of this distribution.
      Array<double> sample(int nsamples, Random random) Generates random samples from this distribution using the specified random generator.
      MatrixCell getProcess()
      • Methods inherited from class jline.lang.processes.DiscreteDistribution

        evalPMF, evalPMF, evalPMF
      • Methods inherited from class jline.lang.processes.Distribution

        evalProbInterval, getName, getNumParams, getParam, getRate, getSupport, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, sample, scv, setNumParams, setParam, skewness, support, var
      • Methods inherited from class jline.lang.Copyable

        copy
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Bernoulli

        Bernoulli(double prob)
    • Method Detail

      • evalCDF

         double evalCDF(double t)

        Evaluates the cumulative distribution function (CDF) at the given point.

        Parameters:
        t - the point at which to evaluate the CDF
        Returns:

        the CDF value at point t

      • evalLST

         double evalLST(double s)

        Evaluates the Laplace-Stieltjes Transform at s. For Bernoulli(p), LST(s) = (1 - p + p*e^(-s))

        Parameters:
        s - the Laplace domain variable
        Returns:

        the LST value at s

      • getMean

         double getMean()

        Gets the mean (expected value) of this distribution.

        Returns:

        the mean value

      • getSCV

         double getSCV()

        Gets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.

        Returns:

        the squared coefficient of variation

      • getSkewness

         double getSkewness()

        Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.

        Returns:

        the skewness value

      • getVar

         double getVar()

        Gets the variance of this distribution. Computed as SCV * mean^2.

        Returns:

        the variance

      • sample

         Array<double> sample(int nsamples, Random random)

        Generates random samples from this distribution using the specified random generator.

        Parameters:
        random - the random number generator to use
        Returns:

        array of random samples