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
    Constructor
    Description
    COptQuestWeibullDistribution(double shape, double scale)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    cdf(double x)
     
    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.
    double
    chaz(double x)
     
    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.
    double
    haz(double x)
     
    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.
    double
    pdf(double x)
     
    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.
    double
    ppf(double x)
     
    static double
    PPF(double p, double shape, double scale)
    Weibull Distribution Percent Point Function (PPF), the inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a Weibull distribution with specified shape and scale parameters.
    double
    sf(double x)
     
    static double
    SF(double x, double shape, double scale)
    Weibull survival function, S(x) = exp(-(x/scale)^shape).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • COptQuestWeibullDistribution

      public COptQuestWeibullDistribution(double shape, double scale)
  • Method Details

    • pdf

      public double pdf(double x)
      Specified by:
      pdf in interface com.opttek.optquest.IProbabilityDistribution
    • cdf

      public double cdf(double x)
      Specified by:
      cdf in interface com.opttek.optquest.IProbabilityDistribution
    • ppf

      public double ppf(double x)
      Specified by:
      ppf in interface com.opttek.optquest.IProbabilityDistribution
    • sf

      public double sf(double x)
      Specified by:
      sf in interface com.opttek.optquest.IProbabilityDistribution
    • SF

      public static double SF(double x, double shape, double scale)
      Weibull survival function, S(x) = exp(-(x/scale)^shape).

      Computed directly rather than as 1 - CDF(x): in the upper tail the complement loses every significant digit once the CDF rounds to 1.

    • chaz

      public double chaz(double x)
      Specified by:
      chaz in interface com.opttek.optquest.IProbabilityDistribution
    • haz

      public double haz(double x)
      Specified by:
      haz in interface com.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), the 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