random
Random arrays from from a given one-, two-, or three-parameter distribution.
The variable name must be a string that names the distribution from which to sample. If this distribution is a one-parameter distribution arg1 should be supplied, if it is a two-parameter distribution arg2 must also be supplied, and if it is a three-parameter distribution arg3 must also be present. Any arguments following the distribution parameters will determine the size of the result.
When called with a single size argument, return a square matrix with the dimension specified. When called with more than one scalar argument the first two arguments are taken as the number of rows and columns and any further arguments specify additional matrix dimensions. The size may also be specified with a vector of dimensions sz.
As an example, the following code generates a 10 by 20 matrix containing random numbers from a normal distribution with mean 5 and standard deviation 2.
R = random("normal", 5, 2, [10, 20]); |
name must be a char string of the name or the abbreviation of the
desired probability distribution function as listed in the followng table.
The last column shows the required number of parameters that must be passed
passed to the desired *rnd
distribution function.
Distribution Name | Abbreviation | Required Parameters | ||
---|---|---|---|---|
"Birnbaum-Saunders" | "bbs" | 3 | ||
"Beta" | "beta" | 2 | ||
"Binomial" | "bino" | 2 | ||
"Burr" | "burr" | 3 | ||
"Cauchy" | "cauchy" | 2 | ||
"Chi-square" | "chi2" | 1 | ||
"Copula Family" | "copula" | 2-4 no size args | ||
"Extreme Value" | "ev" | 2 | ||
"Exponential" | "exp" | 1 | ||
"F-Distribution" | "f" | 2 | ||
"Gamma" | "gam" | 2 | ||
"Geometric" | "geo" | 1 | ||
"Generalized Extreme Value" | "gev" | 3 | ||
"Generalized Pareto" | "gp" | 3 | ||
"Hypergeometric" | "hyge" | 3 | ||
"Inverse Wishart" | "iwish" | 3-4 no size args | ||
"Laplace" | "laplace" | 2 | ||
"Logistic" | "logistic" | 2 | ||
"Lognormal" | "logn" | 2 | ||
"Multinomial" | "mn" | 2 | ||
"Multivariate Normal" | "mvn" | 2-4 no size args | ||
"Multivariate Student T" | "mvt" | 2 | ||
"Nakagami" | "naka" | 2 | ||
"Negative Binomial" | "nbin" | 2 | ||
"Noncentral F-Distribution" | "ncf" | 3 | ||
"Noncentral Student T" | "nct" | 2 | ||
"Noncentral Chi-Square" | "ncx2" | 2 | ||
"Normal" | "norm" | 2 | ||
"Poisson" | "poiss" | 1 | ||
"Rayleigh" | "rayl" | 1 | ||
"Standard Normal" | "stdnormal" | 0 | ||
"Student T" | "t" | 1 | ||
"Triangular" | "tri" | 3 | ||
"Discrete Uniform" | "unid" | 1 | ||
"Uniform" | "unif" | 2 | ||
"Von Mises" | "vm" | 2 | ||
"Weibull" | "wbl" | 2 | ||
"Wiener Process" | "wien" | 1-3 no size args | ||
"Wishart" | "wish" | 3-4 no size args |
See also: cdf, icdf, pdf, bbsrnd, betarnd, binornd, burrrnd, cauchy_rnd, chi2rnd, copularnd, evrnd, exprnd, frnd, gamrnd, geornd, gevrnd, gprnd, hygernd, iwishrnd, laplace_rnd, logistic_rnd, lognrnd, mnrnd, mvnrnd, mvtrnd, nakarnd, nbinrnd, ncfrnd, nctrnd, ncx2rnd, normrnd, poissrnd, raylrnd, stdnormal_rnd, trnd, trirnd, unidrnd, unifrnd, vmrnd, wblrnd, wienrnd, wishrnd
Source Code: random