The algorithm may fail for some distributions for which the density becomes infinite at a point (for ex. the Gamma and the Beta distributions with α < 1) if one chooses too high a precision (a too small eps, for ex. ε∼10-15). However, it should work also for continuous densities with finite discontinuities.
While the setup time for this class is relatively slow, the numerical inversion is extremely fast and practically independent of the required precision and of the specific distribution. For comparisons between the times of standard inversion and inversion from this class as well as comparisons between setup times, see the introduction in class {@link umontreal.iro.lecuyer.randvar.InverseFromDensityGen InverseFromDensityGen}from package randvar.
Thus if only a few inverses are needed, then using this class is not efficient because of the slow set-up. But if one wants to call inverseF thousands of times or more, then using this class will be very efficient.
|
|
|
|