Package com.opttek.optquest
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 -
Method Summary
Modifier and TypeMethodDescriptiondoublecdf(double x) static doubleCDF(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.doublechaz(double x) doublehaz(double x) doublepdf(double x) static doublePDF(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.doubleppf(double x) static doublePPF(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.doublesf(double x) static doubleSF(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.
-
Constructor Details
-
COptQuestCauchyDistribution
public COptQuestCauchyDistribution(double location, 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 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 CDFlocation- the location parameter (a) - shifts the distribution horizontallyscale- 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 PDFlocation- the location parameter (a) - shifts the distribution horizontallyscale- 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 horizontallyscale- 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 functionlocation- the location parameter (a) - shifts the distribution horizontallyscale- the scale parameter (b > 0) - controls the spread of the distribution- Returns:
- the survival probability P(X > x)
-