# How to generate multiple draws using a non-default random number generator

0

I would like to use one of the optional random number generators in GAUSS (mrg32k3a, Wichmann-Hill, MT2203, etc). I see from the documentation that I can create a state vector for one of these like this:

```seed = 889080234;
state_1 = rndCreateState("mrg32k3a", seed);
```

I understand that when I pass this state variable into one of the GAUSS random number functions, it will create a sequence using the mrg32k3a. For example:

```{ r_1, state_2 } = rndn(100, 1, state_1);
```

However, if take the state vector that is returned by this call and pass it into rndn will this second call still be using the mrg32k3a? For example:

```{ r_2, state_3 } = rndn(100, 1, state_2);
```

0

Yes, the state vector determines which underlying generator the function will use. The random number generating functions in GAUSS will always return the same type of state vector which was passed in. So both r_1 and r_2 in your example will be created using the mrg32k3a.

However, if you do NOT pass in a state vector, then GAUSS will use an internally handled state vector which uses the default generator (Mersenne-Twister). For example:

```state_1 = rndCreateState("mrg32k3a", 54443);

//Use the 'mrg32k3a'
{ r_1, state_1 } = rndn(100, 1);

//Use the internally managed state vector
//which defaults to the Mersenne-Twister
r_2 = rndn(100, 1);
```

0

Yes, the state vector determines which underlying generator the function will use. The random number generating functions in GAUSS will always return the same type of state vector which was passed in. So both r_1 and r_2 in your example will be created using the mrg32k3a.

However, if you do NOT pass in a state vector, then GAUSS will use an internally handled state vector which uses the default generator (Mersenne-Twister). For example:

```state_1 = rndCreateState("mrg32k3a", 54443);

//Use the 'mrg32k3a'
{ r_1, state_1 } = rndn(100, 1);

//Use the internally managed state vector
//which defaults to the Mersenne-Twister
r_2 = rndn(100, 1);
```

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!