Class Bernoulli
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.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
-
-
Constructor Summary
Constructors Constructor Description Bernoulli(double prob)
-
Method Summary
Modifier and Type Method Description doubleevalCDF(int t)doubleevalCDF(double t)Evaluates the cumulative distribution function (CDF) at the given point. doubleevalPMF(int k)doubleevalLST(double s)Evaluates the Laplace-Stieltjes Transform at s. doublegetMean()Gets the mean (expected value) of this distribution. doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution. doublegetSkewness()Gets the skewness of this distribution. doublegetVar()Gets the variance of this distribution. Array<double>sample(int nsamples, Random random)Generates random samples from this distribution using the specified random generator. MatrixCellgetProcess()-
Methods inherited from class jline.lang.processes.DiscreteDistribution
evalPMF, evalPMF, evalPMF -
Methods inherited from class jline.lang.processes.Distribution
evalProbInterval, getName, getNumParams, getParam, getRate, getSupport, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, sample, scv, setNumParams, setParam, skewness, support, var -
Methods inherited from class jline.lang.Copyable
copy -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
evalCDF
double evalCDF(int t)
-
evalCDF
double evalCDF(double t)
Evaluates the cumulative distribution function (CDF) at the given point.
- Parameters:
t- the point at which to evaluate the CDF- Returns:
the CDF value at point t
-
evalPMF
double evalPMF(int k)
-
evalLST
double evalLST(double s)
Evaluates the Laplace-Stieltjes Transform at s. For Bernoulli(p), LST(s) = (1 - p + p*e^(-s))
- Parameters:
s- the Laplace domain variable- Returns:
the LST value at s
-
getMean
double getMean()
Gets the mean (expected value) of this distribution.
- Returns:
the mean value
-
getSCV
double getSCV()
Gets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.
- Returns:
the squared coefficient of variation
-
getSkewness
double getSkewness()
Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.
- Returns:
the skewness value
-
getVar
double getVar()
Gets the variance of this distribution. Computed as SCV * mean^2.
- Returns:
the variance
-
sample
Array<double> sample(int nsamples, Random random)
Generates random samples from this distribution using the specified random generator.
- Parameters:
random- the random number generator to use- Returns:
array of random samples
-
getProcess
MatrixCell getProcess()
-
-
-
-