Class Bernoulli

All Implemented Interfaces:
Serializable, 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
See Also:
  • Constructor Details

    • Bernoulli

      public Bernoulli(double prob)
  • Method Details

    • evalCDF

      public double evalCDF(int t)
    • evalCDF

      public double evalCDF(double t)
      Description copied from class: Distribution
      Evaluates the cumulative distribution function (CDF) at the given point.
      Specified by:
      evalCDF in class Distribution
      Parameters:
      t - the point at which to evaluate the CDF
      Returns:
      the CDF value at point t
    • evalPMF

      public double evalPMF(int k)
    • evalLST

      public double evalLST(double s)
      Evaluates the Laplace-Stieltjes Transform at s. For Bernoulli(p), LST(s) = (1 - p + p*e^(-s))
      Overrides:
      evalLST in class DiscreteDistribution
      Parameters:
      s - the Laplace domain variable
      Returns:
      the LST value at s
    • getMean

      public double getMean()
      Description copied from class: Distribution
      Gets the mean (expected value) of this distribution.
      Specified by:
      getMean in class Distribution
      Returns:
      the mean value
    • getSCV

      public double getSCV()
      Description copied from class: Distribution
      Gets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.
      Specified by:
      getSCV in class Distribution
      Returns:
      the squared coefficient of variation
    • getSkewness

      public double getSkewness()
      Description copied from class: Distribution
      Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.
      Specified by:
      getSkewness in class Distribution
      Returns:
      the skewness value
    • getVar

      public double getVar()
      Description copied from class: Distribution
      Gets the variance of this distribution. Computed as SCV * mean^2.
      Overrides:
      getVar in class Distribution
      Returns:
      the variance
    • sample

      public double[] sample(int nsamples, Random random)
      Description copied from class: Distribution
      Generates random samples from this distribution using the specified random generator.
      Specified by:
      sample in class Distribution
      Parameters:
      nsamples - the number of samples to generate
      random - the random number generator to use
      Returns:
      array of random samples
    • getProcess

      public MatrixCell getProcess()