Class COptQuestCauchyDistribution

java.lang.Object
com.opttek.optquest.COptQuestCauchyDistribution
All Implemented Interfaces:
com.opttek.optquest.IProbabilityDistribution

public class COptQuestCauchyDistribution extends Object implements com.opttek.optquest.IProbabilityDistribution
  • Constructor Summary

    Constructors
    Constructor
    Description
    COptQuestCauchyDistribution(double location, double scale)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    cdf(double x)
     
    static double
    CDF(double x, double location, double scale)
    Cauchy Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a Cauchy distribution with location parameter a and scale parameter b.
    double
    chaz(double x)
     
    double
    haz(double x)
     
    double
    pdf(double x)
     
    static double
    PDF(double x, double location, double scale)
    Cauchy Probability Density Function (PDF) Computes the probability density at x for a Cauchy distribution with location parameter a and scale parameter b.
    double
    ppf(double x)
     
    static double
    PPF(double p, double location, double scale)
    Cauchy Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a Cauchy distribution with location parameter a and scale parameter b.
    double
    sf(double x)
     
    static double
    SF(double x, double location, double scale)
    Cauchy Survival Function (1 - CDF) Computes P(X > x) where X follows a Cauchy distribution with location parameter a and scale parameter b.

    Methods inherited from class java.lang.Object

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

    • COptQuestCauchyDistribution

      public COptQuestCauchyDistribution(double location, 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
    • 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 location, double scale)
      Cauchy Cumulative Distribution Function (CDF) Computes P(X ≤ x) where X follows a Cauchy distribution with location parameter a and scale parameter b. Uses the analytical formula: F(x) = (1/π) * arctan((x - a) / b) + 1/2 The CDF represents the probability that a random variable following the Cauchy distribution takes a value less than or equal to x.
      Parameters:
      x - the value at which to evaluate the CDF
      location - the location parameter (a) - shifts the distribution horizontally
      scale - the scale parameter (b > 0) - controls the spread of the distribution
      Returns:
      the cumulative probability P(X ≤ x)
    • PDF

      public static double PDF(double x, double location, double scale)
      Cauchy Probability Density Function (PDF) Computes the probability density at x for a Cauchy distribution with location parameter a and scale parameter b. Uses the analytical formula: f(x) = 1 / (π * b * (1 + ((x - a) / b)²)) The PDF represents the relative likelihood of the random variable taking the value x. The Cauchy distribution has a characteristic bell shape with heavy tails.
      Parameters:
      x - the value at which to evaluate the PDF
      location - the location parameter (a) - shifts the distribution horizontally
      scale - the scale parameter (b > 0) - controls the spread of the distribution
      Returns:
      the probability density at x
    • PPF

      public static double PPF(double p, double location, double scale)
      Cauchy Percent Point Function (PPF) - Inverse CDF Computes the value x such that P(X ≤ x) = p, where X follows a Cauchy distribution with location parameter a and scale parameter b. Uses the analytical inverse formula: Q(p) = a + b * tan(π * (p - 1/2)) This function is the inverse of the CDF and provides quantiles of the distribution. The Cauchy distribution has a simple closed-form inverse CDF.
      Parameters:
      p - the probability (must be between 0 and 1, inclusive)
      location - the location parameter (a) - shifts the distribution horizontally
      scale - the scale parameter (b > 0) - controls the spread of the distribution
      Returns:
      the value x such that CDF(x, location, scale) = p
    • SF

      public static double SF(double x, double location, double scale)
      Cauchy Survival Function (1 - CDF) Computes P(X > x) where X follows a Cauchy distribution with location parameter a and scale parameter b. This is equivalent to 1 - CDF(x). Uses the analytical formula: S(x) = 1/2 - (1/π) * arctan((x - a) / b) The survival function represents the probability that a random variable following the Cauchy distribution takes a value greater than x. This implementation uses direct calculation rather than 1 - CDF for better numerical stability.
      Parameters:
      x - the value at which to evaluate the survival function
      location - the location parameter (a) - shifts the distribution horizontally
      scale - the scale parameter (b > 0) - controls the spread of the distribution
      Returns:
      the survival probability P(X > x)