nag_ran_sample_vec (g05ejc) selects a pseudorandom sample without replacement from an integer vector.
nag_ran_sample_vec (g05ejc) performs a single pseudorandom selection of
elements from vector
ia of length
and then places them in vector
iz. Their order in
ia will be preserved in
iz. Each of the
possible combinations of elements of
ia may be regarded as being equiprobable.
Not applicable.
In order to sample other kinds of objects (i.e., vectors, or matrices of higher dimensions), the following technique may be used:
| (a) |
Set , for (where is the number of objects) |
| (b) |
Use nag_ran_sample_vec (g05ejc) to take a sample from ia and put it into iz |
| (c) |
Use the contents of iz as a set of indices to access the relevant object. |
In order to divide a population into several groups,
nag_ran_permut_vec (g05ehc) is more efficient.
None.