Package com.opttek.optquest
Class COptQuestUniformDistribution
java.lang.Object
com.opttek.optquest.COptQuestUniformDistribution
- All Implemented Interfaces:
com.opttek.optquest.IProbabilityDistribution
public class COptQuestUniformDistribution
extends Object
implements com.opttek.optquest.IProbabilityDistribution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecdf(double x) static doubleCDF(double x, double min, double max) Uniform Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a uniform distribution U(min, max).doublechaz(double x) static doubleCHAZ(double x, double min, double max) Uniform 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, double min, double max) Uniform Hazard Function Computes the hazard function 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, double min, double max) Uniform Probability Density Function (PDF) Computes the probability density at x for a uniform distribution U(min, max).doubleppf(double x) static doublePPF(double p, double min, double max) Uniform Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a uniform distribution U(min, max).doublesf(double x) static doubleSF(double x, double min, double max) Uniform Survival Function (SF) Computes P(X > x) where X follows a uniform distribution U(min, max).
-
Constructor Details
-
COptQuestUniformDistribution
public COptQuestUniformDistribution(double min, double max)
-
-
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
-
PDF
public static double PDF(double x, double min, double max) Uniform Probability Density Function (PDF) Computes the probability density at x for a uniform distribution U(min, max). Formula: f(x) = 1/(max-min) for min ≤ x ≤ max, 0 otherwise- Parameters:
x- the value at which to evaluate the PDFmin- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the probability density at x
-
CDF
public static double CDF(double x, double min, double max) Uniform Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a uniform distribution U(min, max). Formula: F(x) = 0 for x < min, (x-min)/(max-min) for min ≤ x ≤ max, 1 for x > max- Parameters:
x- the value at which to evaluate the CDFmin- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the cumulative probability P(X ≤ x)
-
PPF
public static double PPF(double p, double min, double max) Uniform Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a uniform distribution U(min, max). Formula: F^(-1)(p) = min + p*(max-min) for 0 ≤ p ≤ 1- Parameters:
p- the probability (must be between 0 and 1, inclusive)min- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the value x such that CDF(x) = p
-
SF
public static double SF(double x, double min, double max) Uniform Survival Function (SF) Computes P(X > x) where X follows a uniform distribution U(min, max). Formula: S(x) = 1 for x ≤ min, (max-x)/(max-min) for min < x < max, 0 for x ≥ max- Parameters:
x- the value at which to evaluate the survival functionmin- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the survival probability P(X > x)
-
CHAZ
public static double CHAZ(double x, double min, double max) Uniform Cumulative Hazard Function Computes the cumulative hazard H(x) = -ln(S(x)) where S(x) is the survival function. For uniform distribution: H(x) = -ln((max-x)/(max-min)) for min ≤ x < max- Parameters:
x- the value at which to evaluate the cumulative hazardmin- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the cumulative hazard value
-
HAZ
public static double HAZ(double x, double min, double max) Uniform Hazard Function Computes the hazard function h(x) = f(x)/S(x) where f(x) is the PDF and S(x) is the survival function. For uniform distribution: h(x) = 1/(max-x) for min ≤ x < max- Parameters:
x- the value at which to evaluate the hazard functionmin- the lower bound of the uniform distributionmax- the upper bound of the uniform distribution- Returns:
- the hazard value
-