ArrayTools[RandomArray] - randomly generate scalars, Matrices, and Arrays of values drawn from a uniform or normal distribution
|
Calling Sequence
|
|
RandomArray();
RandomArray(distribution = uniform);
RandomArray(n);
RandomArray(n, distribution = uniform);
RandomArray(m, n);
RandomArray(m, n, distribution = uniform);
RandomArray(m, n, o, ...);
RandomArray(m, n, o, ..., distribution = uniform);
RandomArray(distribution = normal);
RandomArray(n, distribution = normal);
RandomArray(m, n, distribution = normal);
RandomArray(m, n, o, ..., distribution = normal);
|
|
Parameters
|
|
m, n, o, ...
|
-
|
length of each dimension
|
distribution = uniform, distribution = normal
|
-
|
type of a statistic distribution
|
|
|
|
|
Description
|
|
•
|
The RandomArray() and RandomArray(distribution = uniform) functions randomly generate a scalar value drawn from a uniform distribution on the unit interval.
|
•
|
The RandomArray(n) and RandomArray(n, distribution = uniform) functions randomly generate an n-by-n matrix of values derived as described above.
|
•
|
The RandomArray(m, n) and RandomArray(m, n, distribution = uniform) functions randomly generate an m-by-n matrix of the same.
|
•
|
The RandomArray(m, n, o, ...) and RandomArray(m, n, o, ..., distribution = uniform) functions randomly generate an m-by-n-by-o-by-... array of the same.
|
•
|
The RandomArray(distribution = normal) function randomly generates a scalar value drawn from a standard normal distribution.
|
•
|
The RandomArray(n, distribution = normal) function randomly generates an n-by-n matrix of values derived as described above.
|
•
|
The RandomArray(m, n, distribution = normal) function randomly generates an m-by-n matrix of the same.
|
•
|
The RandomArray(m, n, o, ..., distribution = normal) function randomly generates an m-by-n-by-o-by-... array of the same.
|
•
|
A negative entry for the length of a dimension is treated as zero.
|
•
|
This function is part of the ArrayTools package, so it can be used in the short form RandomArray(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[RandomArray](..).
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
|
|