rndGeo#
Purpose#
Computes geometric pseudo-random numbers with a choice of underlying random number generator.
Format#
- y = rndGeo(r, c, prob)#
- { y, newstate } = rndGeo(r, c, prob, state)
- Parameters:
r (scalar) – row dimension.
c (scalar) – column dimension.
prob (scalar or matrix) – probability parameter, scalar or matrix ExE conformable with r and c columns
state (scalar or opaque vector) –
Optional argument.
scalar case
state = starting seed value only. If -1, GAUSS computes the starting seed based on the system clock.
opaque vector case
state = the state vector returned from a previous call to one of the
rndrandom number functions.
- Returns:
y (RxC matrix) – of geometrically distributed random numbers.
newstate (Opaque vector) – the updated state.
Remarks#
The properties of the pseudo-random numbers in y are:
r and c will be truncated to integers if necessary.
Examples#
// Set seed for repeatable output
rndseed 12345;
// Generate a 3x2 matrix of geometric
// random numbers with probability = 0.4
y = rndGeo(3, 2, 0.4);
print y;
After the code above, y is:
0.0000000 1.0000000
0.0000000 4.0000000
1.0000000 5.0000000
See also
Functions rndCreateState(), rndStateSkip()