Class Distribution
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public abstract class Distribution implements Copyable
An abstract class of a general distribution
-
-
Constructor Summary
Constructors Constructor Description Distribution(String name, int numParam, Pair<Double, Double> support)Creates a new distribution with the specified characteristics.
-
Method Summary
Modifier and Type Method Description abstract doubleevalCDF(double t)Evaluates the cumulative distribution function (CDF) at the given point. doubleevalProbInterval(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. StringgetName()Gets the name of this distribution type. intgetNumParams(int id)Gets the number of parameters for this distribution. NamedParamgetParam(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 doublegetSkewness()Gets the skewness of this distribution. Pair<Double, Double>getSupport()Gets the support range of this distribution. doublegetVar()Gets the variance of this distribution. booleanisContinuous()Checks if this is a continuous distribution. booleanisDisabled()Checks if this is a disabled distribution. booleanisDiscrete()Checks if this is a discrete distribution. booleanisImmediate()Checks if this distribution has immediate (zero) service time. Array<double>sample(int n)Generates random samples from this distribution using default random generator. abstract Array<double>sample(int n, Random random)Generates random samples from this distribution using the specified random generator. voidsetNumParams(int num)Sets the number of parameters for this distribution. voidsetParam(int id, String name, Object value)Sets a parameter value for this distribution. abstract doubleevalLST(double s)Evaluate the Laplace-Stieltjes Transform at s booleanisMarkovian()Check if this distribution is Markovian (has a matrix process representation) Stringname()Kotlin-style property alias for getName() doublemean()Kotlin-style property alias for getMean() doublerate()Kotlin-style property alias for getRate() doublescv()Kotlin-style property alias for getSCV() doubleskewness()Kotlin-style property alias for getSkewness() doublevar()Kotlin-style property alias for getVar() Pair<Double, Double>support()Kotlin-style property alias for getSupport() intnumParams(int id)Kotlin-style property alias for getNumParams(int id) NamedParamparam(int id)Kotlin-style property alias for getParam(int id) -
-
Constructor Detail
-
Distribution
Distribution(String name, int numParam, Pair<Double, Double> support)
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 Detail
-
evalCDF
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
double evalProbInterval(double t0, double t1)
Evaluates the probability of the distribution falling within the given interval. Computes P(t0 <= X <= 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]
-
getMean
abstract double getMean()
Gets the mean (expected value) of this distribution.
- Returns:
the mean value
-
getNumParams
int getNumParams(int id)
Gets the number of parameters for this distribution.
- Parameters:
id- parameter identifier (currently unused)- Returns:
the number of parameters
-
getParam
NamedParam getParam(int id)
Gets a parameter by its ID.
- Parameters:
id- the parameter ID (1-based index)- Returns:
the named parameter at the specified position
-
getRate
double getRate()
Gets the rate of this distribution (inverse of mean).
- Returns:
the rate value (1/mean)
-
getSCV
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
abstract double getSkewness()
Gets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.
- Returns:
the skewness value
-
getSupport
Pair<Double, Double> getSupport()
Gets the support range of this distribution.
- Returns:
a pair containing [min, max] values where the distribution is defined
-
getVar
double getVar()
Gets the variance of this distribution. Computed as SCV * mean^2.
- Returns:
the variance
-
isContinuous
boolean isContinuous()
Checks if this is a continuous distribution.
- Returns:
true if this is a continuous distribution, false otherwise
-
isDisabled
boolean isDisabled()
Checks if this is a disabled distribution.
- Returns:
true if this is a disabled distribution, false otherwise
-
isDiscrete
boolean isDiscrete()
Checks if this is a discrete distribution.
- Returns:
true if this is a discrete distribution, false otherwise
-
isImmediate
boolean isImmediate()
Checks if this distribution has immediate (zero) service time.
- Returns:
true if the distribution is immediate or has mean <Zero threshold
-
sample
Array<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
abstract Array<double> sample(int n, Random random)
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
void setNumParams(int num)
Sets the number of parameters for this distribution.
- Parameters:
num- the number of parameters
-
setParam
void setParam(int id, String name, Object value)
Sets a parameter value for this distribution.
- Parameters:
id- the parameter ID (1-based index)name- the parameter namevalue- the parameter value
-
evalLST
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
boolean isMarkovian()
Check if this distribution is Markovian (has a matrix process representation)
- Returns:
true if this is a Markovian distribution, false otherwise
-
mean
double mean()
Kotlin-style property alias for getMean()
-
rate
double rate()
Kotlin-style property alias for getRate()
-
scv
double scv()
Kotlin-style property alias for getSCV()
-
skewness
double skewness()
Kotlin-style property alias for getSkewness()
-
var
double var()
Kotlin-style property alias for getVar()
-
numParams
int numParams(int id)
Kotlin-style property alias for getNumParams(int id)
-
param
NamedParam param(int id)
Kotlin-style property alias for getParam(int id)
-
-
-
-