Package com.imsl.stat
Class InverseCdf
java.lang.Object
com.imsl.stat.InverseCdf
- All Implemented Interfaces:
Serializable
Inverse of user-supplied cumulative distribution function.
Class InverseCdf evaluates the inverse of a continuous,
strictly monotone function. Its most obvious use is in evaluating inverses
of continuous distribution functions that can be defined by a user-supplied
function, which implements the InverseCdf interface.
The inverse is computed using regula falsi and/or
bisection, possibly with the Illinois modification (see Dahlquist and Bjorck
1974). A maximum of 100 iterations are performed.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe iteration did not converge -
Constructor Summary
ConstructorsConstructorDescriptionInverseCdf(CdfFunction cdf) Constructor for the inverse of a user-supplied cummulative distribution function. -
Method Summary
Modifier and TypeMethodDescriptiondoubleeval(double p, double guess) Evaluates the inverse CDF function.voidsetTolerance(double tolerance) Sets the tolerance to be used as the convergence criterion.
-
Constructor Details
-
InverseCdf
Constructor for the inverse of a user-supplied cummulative distribution function.- Parameters:
cdf- is aCdfFunctionobject that contains the user-supplied function to be inverted. The cdf function must be continuous and strictly monotone.
-
-
Method Details
-
setTolerance
public void setTolerance(double tolerance) Sets the tolerance to be used as the convergence criterion.- Parameters:
tolerance- adoublescalar value representing the convergence criterion. When the relative change from one iteration to the next is less than tolerance, convergence is assumed. The default value for tolerance is 0.0001.
-
eval
Evaluates the inverse CDF function.- Parameters:
p- adoublescalar value representing the point at which the inverse CDF is desiredguess- adoublescalar value representing an initial estimate of the inverse at p- Returns:
- a
doublescalar value representing the inverse of the CDF at the point p. Cdf(inverseCdf) is "close" to p. - Throws:
InverseCdf.DidNotConvergeException
-