Generates random data from the Poisson probability distribution. There are two forms. |
||
Syntax |
RND = PoissRnd(Mu, Rows, Cols, Seed, State) RND = PoissRnd(Mu, Seed, State) |
|
Arguments |
Name |
Description |
Mu |
Mean of the distribution. A scalar, vector or matrix of positive values. |
|
Rows (optional) |
Number of output rows. A positive integer. Only valid when Mu is a scalar. |
|
Cols (optional) |
Number of output columns. A positive integer. Only valid when Mu is a scalar. |
|
Seed (optional) |
The seed to initialize the random number generator. A positive integer. See Comments below. |
|
Keep (optional) |
Set to "discard" if the state of the pseudo random number is not to be retained for future use. The default is "retain". |
|
Outputs |
Name |
Description |
|
RND |
Random numbers from the Poisson distribution. Its dimensions are determined by the input arguments. See Comments below. |
Example 1 |
Generate two random numbers from the Poisson distribution with Mu = 5 and 3 respectively, with a random seed of 2003 |
|
Syntax |
||
rnd = PoissRnd([5,3],2003) |
||
Results |
||
rnd = 7 2 |
||
Example 2 |
Generate a 1x4 vector of random numbers from the Poisson distribution with Mu = 5, and a random seed of 2003. |
|
Syntax |
||
rnd = PoissRnd(5,1,4,2003) |
||
Results |
||
rnd = 7 3 7 6 |
||
Comments |
If the optional size inputs are omitted, the size of the output is solely determined by the size of the input Mu. Each entry in the output uses the corresponding entries in the input Mu. If the optional size inputs are provided, both must be supplied. In that case Mu must be a scalar and the size of the output is determined by Rows and Cols. That is, the input Mu is used for each element of the output. The Seed can be any number. Using a seed allows a random sequence to be repeated. |
|
See Also: |