Package jline.lang.processes
Class LogLogistic
java.lang.Object
jline.lang.processes.Distribution
jline.lang.processes.ContinuousDistribution
jline.lang.processes.LogLogistic
- All Implemented Interfaces:
Serializable,Copyable
Log-logistic (Fisk) distribution with scale alpha (the median) and shape beta,
F(t) = 1 / (1 + (t/alpha)^(-beta)) for t >= 0.
Its hazard rate is decreasing for beta <= 1 and unimodal for beta > 1, a shape the Weibull and Gamma families cannot produce. Moment k exists only for k < beta, E[X^k] = alpha^k b/sin(b) with b = k*pi/beta, and the SCV is tan(b)/b - 1 with b = pi/beta. See K. S. Trivedi, A. Bobbio, "Reliability and Availability Engineering", Cambridge Univ. Press, 2017, Sec. 3.2.7.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.doubleevalInvCDF(double u) Quantile alpha*(u/(1-u))^(1/beta).doubleevalLST(double s) E[exp(-sX)] = int_0^1 exp(-s Q(u)) du with the quantile Q: the integrand is bounded by one and needs no truncation of the power-law tail.doubleevalPDF(double t) static LogLogisticfitMeanAndSCV(double mean, double scv) Fit shape and scale to a mean and an SCV.doublegetMean()Gets the mean (expected value) of this distribution.doublegetMoment(int k) Raw moment E[X^k], Inf when k >= beta.Raw parameters {shape (beta), scale (alpha)}, the order of Weibull.getProcess.doublegetRate()Gets the rate of this distribution (inverse of mean).doublegetScale()doublegetSCV()Gets the squared coefficient of variation (SCV) of this distribution.doublegetShape()doubleGets the skewness of this distribution.doublegetVar()Gets the variance of this distribution.double[]sample(int n) Generates random samples from this distribution using default random generator.double[]Generates random samples from this distribution using the specified random generator.Methods inherited from class jline.lang.processes.Distribution
evalLST, evalProbInterval, getFeatureName, getName, getNumParams, getNumParams, getParam, getParam, getParams, getSupport, hasParam, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, scv, setNumParams, setParam, skewness, support, var, withDefect, withMassAtOrigin
-
Constructor Details
-
LogLogistic
public LogLogistic(double shape, double scale) - Parameters:
shape- shape beta > 0scale- scale alpha > 0, the median
-
-
Method Details
-
fitMeanAndSCV
Fit shape and scale to a mean and an SCV. The SCV tan(b)/b - 1, b = pi/beta, rises monotonically from 0 to Inf on b in (0, pi/2), so the shape follows from a bracketed root search and the scale from the mean, alpha = MEAN*sin(b)/b. -
getScale
public double getScale() -
getShape
public double getShape() -
getMoment
public double getMoment(int k) Raw moment E[X^k], Inf when k >= beta. -
getMean
public double getMean()Description copied from class:DistributionGets the mean (expected value) of this distribution.- Specified by:
getMeanin classDistribution- Returns:
- the mean value
-
getRate
public double getRate()Description copied from class:DistributionGets the rate of this distribution (inverse of mean).- Overrides:
getRatein classDistribution- Returns:
- the rate value (1/mean)
-
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
-
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
-
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
-
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
-
evalPDF
public double evalPDF(double t) -
evalInvCDF
public double evalInvCDF(double u) Quantile alpha*(u/(1-u))^(1/beta). -
evalLST
public double evalLST(double s) E[exp(-sX)] = int_0^1 exp(-s Q(u)) du with the quantile Q: the integrand is bounded by one and needs no truncation of the power-law tail. Composite Gauss-Legendre on a grid graded toward u = 0, where Q varies fastest for small beta.- Specified by:
evalLSTin classContinuousDistribution- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
sample
Description copied from class:DistributionGenerates random samples from this distribution using the specified random generator.- Specified by:
samplein classDistribution- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-
sample
public double[] sample(int n) Description copied from class:DistributionGenerates random samples from this distribution using default random generator.- Overrides:
samplein classDistribution- Parameters:
n- the number of samples to generate- Returns:
- array of random samples
-
getProcess
Raw parameters {shape (beta), scale (alpha)}, the order of Weibull.getProcess.- Specified by:
getProcessin classContinuousDistribution- Returns:
- MatrixCell with distribution-specific parameters
-