Package jdistlib

Class BetaBinomial


public class BetaBinomial extends GenericDistribution
Beta binomial distribution, taken from gamlss.dist package, plus some underflow guard. Parameterization: mu, sigma, bd.
  • Field Details

    • mu

      protected double mu
    • sigma

      protected double sigma
    • bd

      protected int bd
  • Constructor Details

    • BetaBinomial

      public BetaBinomial(double mu, double sigma, int bd)
  • Method Details

    • density

      public static final double density(double x, double mu, double sigma, double bd, boolean give_log)
      Density
      Parameters:
      x - MUST be an integer!
      mu - MUST be between 0 and 1
      sigma - MUST be > 0
      bd - MUST be an integer!
      give_log -
      Returns:
      density
    • cumulative

      public static final double cumulative(double q, double mu, double sigma, double bd, boolean lower_tail, boolean log_p)
      Cumulative. Computed by manual summation. SLOW!
      Parameters:
      q - MUST be an integer!
      mu - MUST be between 0 and 1
      sigma - MUST be > 0
      bd - MUST be an integer!
      lower_tail -
      log_p -
      Returns:
      cumulative
    • quantile

      public static final double quantile(double p, double mu, double sigma, double bd, boolean lower_tail, boolean log_p)
      Quantile. Computed by manual density check. SLOW!
      Parameters:
      p - MUST be between 0 and 1
      mu - MUST be between 0 and 1
      sigma - MUST be > 0
      bd - MUST be an integer!
      lower_tail -
      log_p -
      Returns:
      quantile
    • random

      public static final double random(double mu, double sigma, double bd, RandomEngine random)
      Random variate
      Parameters:
      mu - MUST be between 0 and 1
      sigma - MUST be > 0
      bd - MUST be an integer!
      random -
      Returns:
      random variate
    • random

      public static final double[] random(int n, double mu, double sigma, double bd, RandomEngine random)
    • density

      public double density(double x, boolean log)
      Specified by:
      density in class GenericDistribution
    • cumulative

      public double cumulative(double p, boolean lower_tail, boolean log_p)
      Specified by:
      cumulative in class GenericDistribution
    • quantile

      public double quantile(double q, boolean lower_tail, boolean log_p)
      Specified by:
      quantile in class GenericDistribution
    • random

      public double random()
      Specified by:
      random in class GenericDistribution