Package jdistlib
Class BetaBinomial
java.lang.Object
jdistlib.generic.GenericDistribution
jdistlib.BetaBinomial
Beta binomial distribution, taken from gamlss.dist package, plus some underflow guard.
Parameterization: mu, sigma, bd.
-
Field Summary
FieldsFields inherited from class jdistlib.generic.GenericDistribution
random -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecumulative(double p, boolean lower_tail, boolean log_p) static final doublecumulative(double q, double mu, double sigma, double bd, boolean lower_tail, boolean log_p) Cumulative.doubledensity(double x, boolean log) static final doubledensity(double x, double mu, double sigma, double bd, boolean give_log) Densitydoublequantile(double q, boolean lower_tail, boolean log_p) static final doublequantile(double p, double mu, double sigma, double bd, boolean lower_tail, boolean log_p) Quantile.doublerandom()static final doublerandom(double mu, double sigma, double bd, RandomEngine random) Random variatestatic final double[]random(int n, double mu, double sigma, double bd, RandomEngine random) Methods inherited from class jdistlib.generic.GenericDistribution
copyBackward, cumulative, cumulative, cumulative, cumulative_hazard, cumulative_hazard, cumulativeInto, density, density, densityInto, getRandomEngine, hazard, hazard, inverse_survival, inverse_survival, quantile, quantile, quantile, quantileInto, random, random, randomInto, setRandomEngine, survival, survival, survival
-
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 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
Random variate- Parameters:
mu- MUST be between 0 and 1sigma- MUST be > 0bd- MUST be an integer!random-- Returns:
- random variate
-
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
-