- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there,
is it possible to use the vdrnguniform routine to generate random numbers, e.g., in the half-openinterval (0,1]? I want to exclude zero (because this may cause a division by zero) without biasing the RNG in any other way.
Thanks in advance!
mgaro
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Mgaro,
Intel MKL version of Uniform generator v[d|s]RngUniform( method, stream, n, r, a, b )allows generating n numbers uniformly distributed on interval [a, b). By proper setting value of ayou would be able to generate random numbers separated from zero. For example, if you use MT19937 BRNG underneath, please set value of a to L/M wherewhere Lis a positive integer, e.g, 1, and M is 2^32. Generally, value of M is defined by type of BRNG (e.g., for MCG59 value of M is equal to 2^59).Please, let me know if thisapproach works for you.
Best,
Andrey
Intel MKL version of Uniform generator v[d|s]RngUniform( method, stream, n, r, a, b )allows generating n numbers uniformly distributed on interval [a, b). By proper setting value of ayou would be able to generate random numbers separated from zero. For example, if you use MT19937 BRNG underneath, please set value of a to L/M wherewhere Lis a positive integer, e.g, 1, and M is 2^32. Generally, value of M is defined by type of BRNG (e.g., for MCG59 value of M is equal to 2^59).Please, let me know if thisapproach works for you.
Best,
Andrey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Andrey,
thanks a lot, this is exactly what I was looking for! I tried the same kind of workaround but I wasn't sure how to determine the lower bound now I know (I'm using the MT19937). It works perfectly fine with 2^-32.
Thanks again!
Best,
mgaro

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page