umontreal.iro.lecuyer.probdist
Class NormalDistQuick
- java.lang.Object
-
- umontreal.iro.lecuyer.probdist.ContinuousDistribution
-
- umontreal.iro.lecuyer.probdist.NormalDist
-
- umontreal.iro.lecuyer.probdist.NormalDistQuick
-
- All Implemented Interfaces:
- Distribution
public class NormalDistQuick extends NormalDist
A variant of the classNormalDist(for the normal distribution with mean μ and variance σ2). The difference is in the implementation of the methodscdf01,barF01andinverseF01, which are faster but less accurate than those of the classNormalDist.
-
-
Field Summary
-
Fields inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
decPrec
-
-
Constructor Summary
Constructors Constructor and Description NormalDistQuick()Constructs a NormalDistQuick object with default parameters μ = 0 and σ = 1.NormalDistQuick(double mu, double sigma)Constructs a NormalDistQuick object with mean μ = mu and standard deviation σ = sigma.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublebarF(double x)Returns the complementary distribution function.static doublebarF(double mu, double sigma, double x)Returns an approximation of 1 - Φ(x), where Φ is the standard normal distribution function, with mean 0 and variance 1.static doublebarF01(double x)Same asbarF(0.0, 1.0, x).doublecdf(double x)Returns the distribution function F(x).static doublecdf(double mu, double sigma, double x)Returns an approximation of Φ(x), where Φ is the standard normal distribution function, with mean 0 and variance 1.static doublecdf01(double x)Same ascdf(0.0, 1.0, x).doubleinverseF(double u)Returns the inverse distribution function x = F-1(u).static doubleinverseF(double mu, double sigma, double u)Returns an approximation of Φ-1(u), where Φ is the standard normal distribution function, with mean 0 and variance 1.static doubleinverseF01(double u)Same asinverseF(0.0, 1.0, u).-
Methods inherited from class umontreal.iro.lecuyer.probdist.NormalDist
density, density, density01, getInstanceFromMLE, getMean, getMean, getMLE, getMu, getParams, getSigma, getStandardDeviation, getStandardDeviation, getVariance, getVariance, setParams, toString
-
Methods inherited from class umontreal.iro.lecuyer.probdist.ContinuousDistribution
getXinf, getXsup, inverseBisection, inverseBrent, setXinf, setXsup
-
-
-
-
Constructor Detail
-
NormalDistQuick
public NormalDistQuick()
Constructs a NormalDistQuick object with default parameters μ = 0 and σ = 1.
-
NormalDistQuick
public NormalDistQuick(double mu, double sigma)Constructs a NormalDistQuick object with mean μ = mu and standard deviation σ = sigma.
-
-
Method Detail
-
cdf
public double cdf(double x)
Description copied from interface:DistributionReturns the distribution function F(x).- Specified by:
cdfin interfaceDistribution- Overrides:
cdfin classNormalDist- Parameters:
x- value at which the distribution function is evaluated- Returns:
- distribution function evaluated at x
-
barF
public double barF(double x)
Description copied from class:ContinuousDistributionReturns the complementary distribution function. The default implementation computes bar(F)(x) = 1 - F(x).- Specified by:
barFin interfaceDistribution- Overrides:
barFin classNormalDist- Parameters:
x- value at which the complementary distribution function is evaluated- Returns:
- complementary distribution function evaluated at x
-
inverseF
public double inverseF(double u)
Description copied from class:ContinuousDistributionReturns the inverse distribution function x = F-1(u). Restrictions: u∈[0, 1].- Specified by:
inverseFin interfaceDistribution- Overrides:
inverseFin classNormalDist- Parameters:
u- value at which the inverse distribution function is evaluated- Returns:
- the inverse distribution function evaluated at u
-
cdf01
public static double cdf01(double x)
Same ascdf(0.0, 1.0, x).
-
cdf
public static double cdf(double mu, double sigma, double x)Returns an approximation of Φ(x), where Φ is the standard normal distribution function, with mean 0 and variance 1. Uses Marsaglia et al's fast method with table lookups. Returns 15 decimal digits of precision. This method is approximately 60% faster than NormalDist.cdf.
-
barF01
public static double barF01(double x)
Same asbarF(0.0, 1.0, x).
-
barF
public static double barF(double mu, double sigma, double x)Returns an approximation of 1 - Φ(x), where Φ is the standard normal distribution function, with mean 0 and variance 1. Uses Marsaglia et al's fast method with table lookups. Returns 15 decimal digits of precision. This method is approximately twice faster than NormalDist.barF.
-
inverseF01
public static double inverseF01(double u)
Same asinverseF(0.0, 1.0, u).
-
inverseF
public static double inverseF(double mu, double sigma, double u)Returns an approximation of Φ-1(u), where Φ is the standard normal distribution function, with mean 0 and variance 1. Uses the method of Marsaglia, Zaman, and Marsaglia, with table lookups. Returns 6 decimal digits of precision. This method is approximately 20% faster than NormalDist.inverseF.
-
-
DMelt 3.0 © DataMelt by jWork.ORG