Class Binomial

All Implemented Interfaces:
Serializable, Copyable

public class Binomial extends DiscreteDistribution implements Serializable
A Binomial distribution
See Also:
  • Constructor Details

    • Binomial

      public Binomial(int n, 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 Binomial(n, p), LST(s) = (1 - p + p*e^(-s))^n
      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()