Friday, November 12, 2010

【Intel VSL】乱数発生時の注意点

 seed(初期条件)を適切に設定すること。2つ以上の乱数を発生させたいときは特に注意。例えば、quasi-random numberの場合、これは確定的な動きをするので、2つの独立するVSLの乱数生成器で(seed = 1として)「乱数発生」させても、両者が全く同じ値をとる。この場合、seed=2としなければならない。

 なお、seedはpseudo-random numberのときは初期値、quasi-random numberのときは次元を表すことに注意。詳しくはVSL Noteを参照。
To obtain a random number sequence from a given basic generator, you should assign initial, or seed values. The assigning procedure is called the generator initialization (the C language function analogous with the initialization function is srand(seed)) in stdlib.h). Different types of basic generators require a different number of initial values. For example, the seed for MCG31m1 is an integral number within the range from 1 to 231–2, the initial values for MRG32k3a are a set of two triples of 32-bit digits, and the seed for MCG59 is an integer within the range from 1 to 259–1. In contrast to the pseudorandom number generators, quasi-random generators require the dimension parameter on input. Thus, each BRNG, including those registered by the user, requires an individual initialization function. However, requiring individual initialization functions within the library interface would limit the versatility of the routines. (VSL Note, p. 31)

No comments:

Post a Comment