excessive LogNormalDistribution timing
- To: mathgroup at yoda.physics.unc.edu
- Subject: excessive LogNormalDistribution timing
- From: wiscombe at climate.gsfc.nasa.gov
- Date: Thu, 1 Oct 92 10:10:57 -0400
Dear Mathgroupers, We need to draw random numbers from some of the continuous distributions provided in the package Statistics`ContinuousDistributions` in Mma 2.0, but we discovered a gross disparity in the timing for the LogNormalDistribution which makes it almost impossible to use for real applications. Here is an example (on a MacIIfx): ran1=Table[Random[ExponentialDistribution[1]], {100} ]//Timing {1. Second,...} ran2=Table[Random[NormalDistribution[0,1]], {100} ]//Timing {1.61667 Second,...} ran3=Table[Random[LogNormalDistribution[0,1]], {100} ]//Timing {110.7 Second,...} There is a factor of 50-100 disparity. Yet LogNormalDistribution only involves one extra Log evaluation compared to ExponentialDistribution or NormalDistribution. What can possibly be wrong here? ------------------------------------------- Dr. Warren J. Wiscombe NASA Goddard, Code 913, Greenbelt, MD 20771 (301) 286-8499