Package jline.lang.processes
Class Bernoulli
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.DiscreteDistribution
jline.lang.processes.Bernoulli
- All Implemented Interfaces:
Serializable,Copyable
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
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.doubleevalCDF(int t) doubleevalLST(double s) Evaluates the Laplace-Stieltjes Transform at s.doubleevalPMF(int k) doublegetMean()Gets the mean (expected value) of this distribution.doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution.doubleGets the skewness of this distribution.doublegetVar()Gets the variance of this distribution.double[]Generates random samples from this distribution using the specified random generator.Methods inherited from class jline.lang.processes.DiscreteDistribution
evalPMF, evalPMF, evalPMFMethods 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
-
Constructor Details
-
Bernoulli
public Bernoulli(double prob)
-
-
Method Details
-
evalCDF
public double evalCDF(int t) -
evalCDF
public double evalCDF(double t) Description copied from class:DistributionEvaluates the cumulative distribution function (CDF) at the given point.- Specified by:
evalCDFin classDistribution- 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 Bernoulli(p), LST(s) = (1 - p + p*e^(-s))- Overrides:
evalLSTin classDiscreteDistribution- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
getMean
public double getMean()Description copied from class:DistributionGets the mean (expected value) of this distribution.- Specified by:
getMeanin classDistribution- Returns:
- the mean value
-
getSCV
public double getSCV()Description copied from class:DistributionGets the squared coefficient of variation (SCV) of this distribution. SCV = Var(X) / E[X]^2.- Specified by:
getSCVin classDistribution- Returns:
- the squared coefficient of variation
-
getSkewness
public double getSkewness()Description copied from class:DistributionGets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.- Specified by:
getSkewnessin classDistribution- Returns:
- the skewness value
-
getVar
public double getVar()Description copied from class:DistributionGets the variance of this distribution. Computed as SCV * mean^2.- Overrides:
getVarin classDistribution- Returns:
- the variance
-
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator.- Specified by:
samplein classDistribution- Parameters:
nsamples- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-
getProcess
-