jdistlib
Class BetaBinomial
- java.lang.Object
-
- jdistlib.generic.GenericDistribution
-
- jdistlib.BetaBinomial
-
public class BetaBinomial extends GenericDistribution
Beta binomial distribution, taken from gamlss.dist package, plus some underflow guard. Parameterization: mu, sigma, bd.
-
-
Constructor Summary
Constructors Constructor and Description BetaBinomial(double mu, double sigma, int bd)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecumulative(double p, boolean lower_tail, boolean log_p)static doublecumulative(double q, double mu, double sigma, double bd, boolean lower_tail, boolean log_p)Cumulative.doubledensity(double x, boolean log)static doubledensity(double x, double mu, double sigma, double bd, boolean give_log)Densitydoublequantile(double q, boolean lower_tail, boolean log_p)static doublequantile(double p, double mu, double sigma, double bd, boolean lower_tail, boolean log_p)Quantile.doublerandom()static doublerandom(double mu, double sigma, double bd, RandomEngine random)Random variatestatic double[]random(int n, double mu, double sigma, double bd, RandomEngine random)-
Methods inherited from class jdistlib.generic.GenericDistribution
cumulative_hazard, cumulative_hazard, cumulative, cumulative, cumulative, density, density, getRandomEngine, hazard, hazard, inverse_survival, inverse_survival, quantile, quantile, quantile, random, random, setRandomEngine, survival, survival, survival
-
-
-
-
Method Detail
-
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 1sigma- MUST be > 0bd- 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 1sigma- MUST be > 0bd- 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 1mu- MUST be between 0 and 1sigma- MUST be > 0bd- 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 1sigma- MUST be > 0bd- 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:
densityin classGenericDistribution
-
cumulative
public double cumulative(double p, boolean lower_tail, boolean log_p)- Specified by:
cumulativein classGenericDistribution
-
quantile
public double quantile(double q, boolean lower_tail, boolean log_p)- Specified by:
quantilein classGenericDistribution
-
random
public double random()
- Specified by:
randomin classGenericDistribution
-
-
DMelt 3.0 © DataMelt by jWork.ORG