Package com.opttek.optquest
Class COptQuestExponentialDistribution
java.lang.Object
com.opttek.optquest.COptQuestExponentialDistribution
- All Implemented Interfaces:
com.opttek.optquest.IProbabilityDistribution
public class COptQuestExponentialDistribution
extends Object
implements com.opttek.optquest.IProbabilityDistribution
This class provides static methods for computing functions of the exponential distribution,
including the cumulative distribution function (CDF), probability density function (PDF),
percent point function (PPF), survival function (SF), hazard function (HAZ),
and cumulative hazard function (CHAZ).
The implementations are verified to match scipy.stats.expon and are inspired by
NIST's DataPlot implementation.
The exponential distribution is parameterized by a positive scale parameter
(mean = scale, rate λ = 1/scale).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecdf(double x) static doubleCDF(double x) Exponential Cumulative Distribution Function with default scale parameter Equivalent to expcdf(x, 1.0).static doubleCDF(double x, double scale) Exponential Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows an exponential distribution with the given scale parameter.doublechaz(double x) static doubleCHAZ(double x) Exponential Cumulative Hazard Function with default scale parameter Equivalent to expchaz(x, 1.0).static doubleCHAZ(double x, double scale) Exponential Cumulative Hazard Function Computes the cumulative hazard H(x) = -ln(S(x)) where S(x) is the survival function.doublehaz(double x) static doubleHAZ(double x) Exponential Hazard Function with default scale parameter Equivalent to exphaz(x, 1.0).static doubleHAZ(double x, double scale) Exponential Hazard Function Computes the hazard rate h(x) = f(x)/S(x) where f(x) is the PDF and S(x) is the survival function.doublepdf(double x) static doublePDF(double x) Exponential Probability Density Function with default scale parameter Equivalent to exppdf(x, 1.0).static doublePDF(double x, double scale) Exponential Probability Density Function (PDF) Computes the probability density at x for an exponential distribution with the given scale parameter.doubleppf(double x) static doublePPF(double p) Exponential Percent Point Function with default scale parameter Equivalent to expppf(p, 1.0).static doublePPF(double p, double scale) Exponential Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows an exponential distribution with the given scale parameter.doublesf(double x) static doubleSF(double x) Exponential Survival Function with default scale parameter Equivalent to expsf(x, 1.0).static doubleSF(double x, double scale) Exponential Survival Function Computes the survival probability S(x) = P(X > x) = 1 - F(x) where F(x) is the CDF.
-
Constructor Details
-
COptQuestExponentialDistribution
public COptQuestExponentialDistribution(double scale)
-
-
Method Details
-
pdf
public double pdf(double x) - Specified by:
pdfin interfacecom.opttek.optquest.IProbabilityDistribution
-
cdf
public double cdf(double x) - Specified by:
cdfin interfacecom.opttek.optquest.IProbabilityDistribution
-
ppf
public double ppf(double x) - Specified by:
ppfin interfacecom.opttek.optquest.IProbabilityDistribution
-
sf
public double sf(double x) - Specified by:
sfin interfacecom.opttek.optquest.IProbabilityDistribution
-
chaz
public double chaz(double x) - Specified by:
chazin interfacecom.opttek.optquest.IProbabilityDistribution
-
haz
public double haz(double x) - Specified by:
hazin interfacecom.opttek.optquest.IProbabilityDistribution
-
CDF
public static double CDF(double x, double scale) Exponential Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows an exponential distribution with the given scale parameter. The CDF is defined as: F(x) = 1 - exp(-x/scale) for x ≥ 0, and 0 for x < 0. The exponential distribution models the time between events in a Poisson point process, where events occur continuously and independently at a constant average rate.- Parameters:
x- the value at which to evaluate the CDF (any real number)scale- the scale parameter (must be positive, λ = 1/scale)- Returns:
- the cumulative probability P(X ≤ x)
-
CDF
public static double CDF(double x) Exponential Cumulative Distribution Function with default scale parameter Equivalent to expcdf(x, 1.0). Uses the standard exponential distribution with rate parameter λ = 1.- Parameters:
x- the value at which to evaluate the CDF- Returns:
- the cumulative probability P(X ≤ x) for standard exponential distribution
-
CHAZ
public static double CHAZ(double x, double scale) Exponential Cumulative Hazard Function Computes the cumulative hazard H(x) = -ln(S(x)) where S(x) is the survival function. For the exponential distribution: H(x) = x/scale for x ≥ 0. The cumulative hazard represents the total accumulated risk up to time x. In reliability analysis, it quantifies the total exposure to failure risk.- Parameters:
x- the value at which to evaluate the cumulative hazard (any real number)scale- the scale parameter (must be positive)- Returns:
- the cumulative hazard H(x)
-
CHAZ
public static double CHAZ(double x) Exponential Cumulative Hazard Function with default scale parameter Equivalent to expchaz(x, 1.0). Uses the standard exponential distribution.- Parameters:
x- the value at which to evaluate the cumulative hazard- Returns:
- the cumulative hazard H(x) for standard exponential distribution
-
HAZ
public static double HAZ(double x, double scale) Exponential Hazard Function Computes the hazard rate h(x) = f(x)/S(x) where f(x) is the PDF and S(x) is the survival function. For the exponential distribution, the hazard rate is constant: h(x) = 1/scale = λ. This constant hazard property is the defining characteristic of the exponential distribution, reflecting the "memoryless" property where the probability of an event in the next instant is independent of how much time has already elapsed.- Parameters:
x- the value at which to evaluate the hazard (not used due to constant hazard)scale- the scale parameter (must be positive)- Returns:
- the constant hazard rate 1/scale
-
HAZ
public static double HAZ(double x) Exponential Hazard Function with default scale parameter Equivalent to exphaz(x, 1.0). Returns the constant hazard rate for the standard exponential distribution.- Parameters:
x- the value at which to evaluate the hazard- Returns:
- the constant hazard rate 1.0 for standard exponential distribution
-
PDF
public static double PDF(double x, double scale) Exponential Probability Density Function (PDF) Computes the probability density at x for an exponential distribution with the given scale parameter. The PDF is defined as: f(x) = (1/scale) * exp(-x/scale) for x ≥ 0, and 0 for x < 0. The PDF represents the relative likelihood of observing a value in an infinitesimal neighborhood around x. For the exponential distribution, this decreases exponentially from its maximum at x = 0.- Parameters:
x- the value at which to evaluate the PDF (any real number)scale- the scale parameter (must be positive)- Returns:
- the probability density at x
-
PDF
public static double PDF(double x) Exponential Probability Density Function with default scale parameter Equivalent to exppdf(x, 1.0). Uses the standard exponential distribution.- Parameters:
x- the value at which to evaluate the PDF- Returns:
- the probability density at x for standard exponential distribution
-
PPF
public static double PPF(double p, double scale) Exponential Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows an exponential distribution with the given scale parameter. Uses the analytical inverse: F^(-1)(p) = -scale * ln(1 - p). This closed-form solution provides exact results without numerical iteration. The PPF is useful for generating random samples and computing confidence intervals.- Parameters:
p- the probability (must be between 0 and 1, exclusive of 1)scale- the scale parameter (must be positive)- Returns:
- the quantile x such that CDF(x, scale) = p
-
PPF
public static double PPF(double p) Exponential Percent Point Function with default scale parameter Equivalent to expppf(p, 1.0). Uses the standard exponential distribution.- Parameters:
p- the probability (must be between 0 and 1, exclusive of 1)- Returns:
- the quantile x such that CDF(x, 1.0) = p
-
SF
public static double SF(double x, double scale) Exponential Survival Function Computes the survival probability S(x) = P(X > x) = 1 - F(x) where F(x) is the CDF. For the exponential distribution: S(x) = exp(-x/scale) for x ≥ 0, and 1 for x < 0. The survival function represents the probability that a random variable X exceeds a given value x. In reliability analysis, this gives the probability that a system survives beyond time x.- Parameters:
x- the value at which to evaluate the survival function (any real number)scale- the scale parameter (must be positive)- Returns:
- the survival probability S(x) = P(X > x)
-
SF
public static double SF(double x) Exponential Survival Function with default scale parameter Equivalent to expsf(x, 1.0). Uses the standard exponential distribution.- Parameters:
x- the value at which to evaluate the survival function- Returns:
- the survival probability S(x) for standard exponential distribution
-