[Gretl-users] random number generation

Allin Cottrell cottrell at wfu.edu
Wed Nov 16 15:31:47 EST 2016


On Wed, 16 Nov 2016, Sven Schreiber wrote:

> Am 16.11.2016 um 01:03 schrieb Allin Cottrell:
>
>> 
>> I don't have much to say about that reference since I'm not sure from
>> looking at Dirk's slides how the timings were obtained. That said, I can
>> say that my timings for 200 replications of (1 million random normals)
>> show R's rnorm() function -- from the current R release -- as taking
>> about 5 times as long as gretl and Octave. Not in the ballpark.
>
> That would seem to be compatible with the comparison of R's "BM" on a 
> previous slide with gretl's Ziggurat, roughly 350ms vs. 70ms. (I think 
> Box-Muller is the default on R, at least in the past.)
>
>> 
>> Maybe Dirk is using a "souped up" alternative to R's standard rnorm().
>> That wasn't clear to me.
>
> My impression is that it's an additional package ("RcppZiggurat"?), which 
> then perhaps provides this function zrnorm() on slide 22.

You're right. Sorry, that should have been obvious to me.

> The difference between "Zigg" and "ZiggGretl" on hte slide 13 is about 20ms 
> vs. 70ms. When you wrote "considerably slower than Octave", what was the 
> factor you had found?

That seems to depend quite substantially on hardware. When Jack 
first raised the normals speed issue, he showed gretl taking more 
than twice as long as octave on his laptop. When I tried the same 
experiment on my machines, I found a difference of around 20 or 30 
percent.

Allin


More information about the Gretl-users mailing list