Package jline.lang.processes
Class Distribution
java.lang.Object
jline.lang.processes.Distribution
- All Implemented Interfaces:
Serializable,Copyable
- Direct Known Subclasses:
ContinuousDistribution,Det,Disabled,DiscreteDistribution,EmpiricalCDF,Immediate,Prior,Replayer
An abstract class of a general distribution
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDistribution(String name, int numParam, Pair<Double, Double> support) Creates a new distribution with the specified characteristics. -
Method Summary
Modifier and TypeMethodDescriptionabstract doubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.abstract doubleevalLST(double s) Evaluate the Laplace-Stieltjes Transform at sdoubleevalProbInterval(double t0, double t1) Evaluates the probability of the distribution falling within the given interval.abstract doublegetMean()Gets the mean (expected value) of this distribution.getName()Gets the name of this distribution type.intgetNumParams(int id) Gets the number of parameters for this distribution.getParam(int id) Gets a parameter by its ID.doublegetRate()Gets the rate of this distribution (inverse of mean).abstract doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution.abstract doubleGets the skewness of this distribution.Gets the support range of this distribution.doublegetVar()Gets the variance of this distribution.booleanChecks if this is a continuous distribution.booleanChecks if this is a disabled distribution.booleanChecks if this is a discrete distribution.booleanChecks if this distribution has immediate (zero) service time.booleanCheck if this distribution is Markovian (has a matrix process representation)doublemean()Kotlin-style property alias for getMean()name()Kotlin-style property alias for getName()intnumParams(int id) Kotlin-style property alias for getNumParams(int id)param(int id) Kotlin-style property alias for getParam(int id)doublerate()Kotlin-style property alias for getRate()double[]sample(int n) Generates random samples from this distribution using default random generator.abstract double[]Generates random samples from this distribution using the specified random generator.doublescv()Kotlin-style property alias for getSCV()voidsetNumParams(int num) Sets the number of parameters for this distribution.voidSets a parameter value for this distribution.doubleskewness()Kotlin-style property alias for getSkewness()support()Kotlin-style property alias for getSupport()doublevar()Kotlin-style property alias for getVar()
-
Field Details
-
mean
protected double mean -
immediate
protected boolean immediate -
name
-
numParam
protected int numParam -
support
-
params
-
-
Constructor Details
-
Distribution
Creates a new distribution with the specified characteristics.- Parameters:
name- the name of this distribution typenumParam- the number of parameters requiredsupport- the support range [min, max] for this distribution
-
-
Method Details
-
evalCDF
public abstract 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
-
evalProbInterval
public double evalProbInterval(double t0, double t1) Evaluates the probability of the distribution falling within the given interval. Computes P(t0 invalid input: '<'= X invalid input: '<'= t1) = F(t1) - F(t0).- Parameters:
t0- the lower bound of the intervalt1- the upper bound of the interval- Returns:
- the probability of falling within [t0, t1]
- Throws:
RuntimeException- if t1 invalid input: '<' t0
-
getMean
public abstract double getMean()Gets the mean (expected value) of this distribution.- Returns:
- the mean value
-
getName
Gets the name of this distribution type.- Returns:
- the distribution name
-
getNumParams
public int getNumParams(int id) Gets the number of parameters for this distribution.- Parameters:
id- parameter identifier (currently unused)- Returns:
- the number of parameters
-
getParam
Gets a parameter by its ID.- Parameters:
id- the parameter ID (1-based index)- Returns:
- the named parameter at the specified position
-
getRate
public double getRate()Gets the rate of this distribution (inverse of mean).- Returns:
- the rate value (1/mean)
-
getSCV
public abstract 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
public abstract double getSkewness()Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.- Returns:
- the skewness value
-
getSupport
Gets the support range of this distribution.- Returns:
- a pair containing [min, max] values where the distribution is defined
-
getVar
public double getVar()Gets the variance of this distribution. Computed as SCV * mean^2.- Returns:
- the variance
-
isContinuous
public boolean isContinuous()Checks if this is a continuous distribution.- Returns:
- true if this is a continuous distribution, false otherwise
-
isDisabled
public boolean isDisabled()Checks if this is a disabled distribution.- Returns:
- true if this is a disabled distribution, false otherwise
-
isDiscrete
public boolean isDiscrete()Checks if this is a discrete distribution.- Returns:
- true if this is a discrete distribution, false otherwise
-
isImmediate
public boolean isImmediate()Checks if this distribution has immediate (zero) service time.- Returns:
- true if the distribution is immediate or has mean invalid input: '<' Zero threshold
-
sample
public double[] sample(int n) Generates random samples from this distribution using default random generator.- Parameters:
n- the number of samples to generate- Returns:
- array of random samples
-
sample
Generates random samples from this distribution using the specified random generator.- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-
setNumParams
public void setNumParams(int num) Sets the number of parameters for this distribution.- Parameters:
num- the number of parameters
-
setParam
Sets a parameter value for this distribution.- Parameters:
id- the parameter ID (1-based index)name- the parameter namevalue- the parameter value
-
evalLST
public abstract double evalLST(double s) Evaluate the Laplace-Stieltjes Transform at s- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
isMarkovian
public boolean isMarkovian()Check if this distribution is Markovian (has a matrix process representation)- Returns:
- true if this is a Markovian distribution, false otherwise
-
name
Kotlin-style property alias for getName() -
mean
public double mean()Kotlin-style property alias for getMean() -
rate
public double rate()Kotlin-style property alias for getRate() -
scv
public double scv()Kotlin-style property alias for getSCV() -
skewness
public double skewness()Kotlin-style property alias for getSkewness() -
var
public double var()Kotlin-style property alias for getVar() -
support
Kotlin-style property alias for getSupport() -
numParams
public int numParams(int id) Kotlin-style property alias for getNumParams(int id) -
param
Kotlin-style property alias for getParam(int id)
-