Package com.opttek.optquest
Class COptQuestPowerDistribution
java.lang.Object
com.opttek.optquest.COptQuestPowerDistribution
- All Implemented Interfaces:
com.opttek.optquest.IProbabilityDistribution
public class COptQuestPowerDistribution
extends Object
implements com.opttek.optquest.IProbabilityDistribution
-
Constructor Summary
ConstructorsConstructorDescriptionCOptQuestPowerDistribution(double rmin, double rmax, double power) Constructs a power distribution for uniform sampling in the radial interval [rmin, rmax]. -
Method Summary
Modifier and TypeMethodDescriptiondoublecdf(double r) static doubleCDF(double r, double power) static doubleCDF(double r, double rmin, double rmax, double power) Computes the CDF of the power-law distribution on [rmin, rmax].doublechaz(double r) static doubleCHAZ(double r, double power) static doubleCHAZ(double r, double rmin, double rmax, double power) Computes the cumulative hazard function CHAZ(r) = -log(SF(r)).doublehaz(double r) static doubleHAZ(double r, double power) static doubleHAZ(double r, double rmin, double rmax, double power) Computes the hazard function HAZ(r) = PDF(r) / SF(r).doublepdf(double r) static doublePDF(double r, double power) static doublePDF(double r, double rmin, double rmax, double power) Computes the PDF of the power-law distribution on [rmin, rmax].doubleppf(double p) static doublePPF(double p, double power) static doublePPF(double p, double rmin, double rmax, double power) Computes the PPF (inverse CDF) for sampling.doublesf(double r) static doubleSF(double r, double power) static doubleSF(double r, double rmin, double rmax, double power) Computes the survival function SF(r) = 1 - CDF(r).
-
Constructor Details
-
COptQuestPowerDistribution
public COptQuestPowerDistribution(double rmin, double rmax, double power) Constructs a power distribution for uniform sampling in the radial interval [rmin, rmax].This distribution is used to generate radii r such that points are uniformly distributed by area (power=2) or volume (power=3) within the annular/spherical shell [rmin, rmax]. When rmin = 0, this reduces to the classic disk/ball sampling from the origin.
- Parameters:
rmin- inner radius (≥ 0)rmax- outer radius (> rmin)power- volume/area exponent (> 0). Use 2 for disk/annulus, 3 for ball/shell.
-
-
Method Details
-
pdf
public double pdf(double r) - Specified by:
pdfin interfacecom.opttek.optquest.IProbabilityDistribution
-
cdf
public double cdf(double r) - Specified by:
cdfin interfacecom.opttek.optquest.IProbabilityDistribution
-
ppf
public double ppf(double p) - Specified by:
ppfin interfacecom.opttek.optquest.IProbabilityDistribution
-
sf
public double sf(double r) - Specified by:
sfin interfacecom.opttek.optquest.IProbabilityDistribution
-
chaz
public double chaz(double r) - Specified by:
chazin interfacecom.opttek.optquest.IProbabilityDistribution
-
haz
public double haz(double r) - Specified by:
hazin interfacecom.opttek.optquest.IProbabilityDistribution
-
PDF
public static double PDF(double r, double rmin, double rmax, double power) Computes the PDF of the power-law distribution on [rmin, rmax].pdf(r) = (power / (rmax^power - rmin^power)) * r^(power-1) for rmin ≤ r ≤ rmax
-
CDF
public static double CDF(double r, double rmin, double rmax, double power) Computes the CDF of the power-law distribution on [rmin, rmax].CDF(r) = (r^power - rmin^power) / (rmax^power - rmin^power)
-
PPF
public static double PPF(double p, double rmin, double rmax, double power) Computes the PPF (inverse CDF) for sampling.ppf(p) = [rmin^power + p * (rmax^power - rmin^power)]^(1/power)
-
SF
public static double SF(double r, double rmin, double rmax, double power) Computes the survival function SF(r) = 1 - CDF(r). -
CHAZ
public static double CHAZ(double r, double rmin, double rmax, double power) Computes the cumulative hazard function CHAZ(r) = -log(SF(r)). -
HAZ
public static double HAZ(double r, double rmin, double rmax, double power) Computes the hazard function HAZ(r) = PDF(r) / SF(r). -
PDF
public static double PDF(double r, double power) -
CDF
public static double CDF(double r, double power) -
PPF
public static double PPF(double p, double power) -
SF
public static double SF(double r, double power) -
CHAZ
public static double CHAZ(double r, double power) -
HAZ
public static double HAZ(double r, double power)
-