Package com.opttek.optquest
Class COptQuestWeibullDistribution
java.lang.Object
com.opttek.optquest.COptQuestWeibullDistribution
- All Implemented Interfaces:
com.opttek.optquest.IProbabilityDistribution
public class COptQuestWeibullDistribution
extends Object
implements com.opttek.optquest.IProbabilityDistribution
Provides static methods for computing various functions of the Weibull distribution.
The Weibull distribution is a continuous probability distribution with parameters shape (k > 0) and scale (λ > 0).
This implementation is verified against scipy.stats.weibull_min and inspired by NIST's DataPlot.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecdf(double x) static doubleCDF(double x, double shape, double scale) Weibull Distribution Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a Weibull distribution with specified shape and scale parameters.doublechaz(double x) static doubleCHAZ(double x, double shape, double scale) Weibull Distribution Cumulative Hazard Function Computes the cumulative hazard at x for a Weibull distribution with specified shape and scale parameters.doublehaz(double x) static doubleHAZ(double x, double shape, double scale) Weibull Distribution Hazard Function Computes the hazard rate at x for a Weibull distribution with specified shape and scale parameters.doublepdf(double x) static doublePDF(double x, double shape, double scale) Weibull Distribution Probability Density Function (PDF) Computes the probability density at x for a Weibull distribution with specified shape and scale parameters.doubleppf(double x) static doublePPF(double p, double shape, double scale) Weibull Distribution Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a Weibull distribution with specified shape and scale parameters.doublesf(double x)
-
Constructor Details
-
COptQuestWeibullDistribution
public COptQuestWeibullDistribution(double shape, 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 shape, double scale) Weibull Distribution Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a Weibull distribution with specified shape and scale parameters. Formula: F(x; k, λ) = 1 - exp(-(x/λ)^k)- Parameters:
x- the value at which to evaluate the CDF (must be non-negative)shape- shape parameter k (must be positive)scale- scale parameter λ (must be positive)- Returns:
- the cumulative probability P(X ≤ x)
-
PDF
public static double PDF(double x, double shape, double scale) Weibull Distribution Probability Density Function (PDF) Computes the probability density at x for a Weibull distribution with specified shape and scale parameters. Formula: f(x; k, λ) = (k/λ) * (x/λ)^(k-1) * exp(-(x/λ)^k)- Parameters:
x- the value at which to evaluate the PDF (must be non-negative)shape- shape parameter k (must be positive)scale- scale parameter λ (must be positive)- Returns:
- the probability density at x
-
PPF
public static double PPF(double p, double shape, double scale) Weibull Distribution Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a Weibull distribution with specified shape and scale parameters. Formula: F^(-1)(p; k, λ) = λ * (-ln(1-p))^(1/k)- Parameters:
p- the probability (must be between 0 and 1, exclusive)shape- shape parameter k (must be positive)scale- scale parameter λ (must be positive)- Returns:
- the value x such that CDF(x, shape, scale) = p
-
HAZ
public static double HAZ(double x, double shape, double scale) Weibull Distribution Hazard Function Computes the hazard rate at x for a Weibull distribution with specified shape and scale parameters. Formula: h(x; k, λ) = (k/λ) * (x/λ)^(k-1)- Parameters:
x- the value at which to evaluate the hazard function (must be non-negative)shape- shape parameter k (must be positive)scale- scale parameter λ (must be positive)- Returns:
- the hazard rate at x
-
CHAZ
public static double CHAZ(double x, double shape, double scale) Weibull Distribution Cumulative Hazard Function Computes the cumulative hazard at x for a Weibull distribution with specified shape and scale parameters. Formula: H(x; k, λ) = (x/λ)^k- Parameters:
x- the value at which to evaluate the cumulative hazard function (must be non-negative)shape- shape parameter k (must be positive)scale- scale parameter λ (must be positive)- Returns:
- the cumulative hazard at x
-