Previous: Tests, Up: Statistics [Contents][Index]
Octave can generate random numbers from a large number of distributions. The random number generators are based on the random number generators described in Special Utility Matrices.
The following table summarizes the available random number generators (in alphabetical order).
Distribution | Function |
---|---|
Beta Distribution | betarnd |
Binomial Distribution | binornd |
Cauchy Distribution | cauchy_rnd |
Chi-Square Distribution | chi2rnd |
Univariate Discrete Distribution | discrete_rnd |
Empirical Distribution | empirical_rnd |
Exponential Distribution | exprnd |
F Distribution | frnd |
Gamma Distribution | gamrnd |
Geometric Distribution | geornd |
Hypergeometric Distribution | hygernd |
Laplace Distribution | laplace_rnd |
Logistic Distribution | logistic_rnd |
Log-Normal Distribution | lognrnd |
Pascal Distribution | nbinrnd |
Univariate Normal Distribution | normrnd |
Poisson Distribution | poissrnd |
Standard Normal Distribution | stdnormal_rnd |
t (Student) Distribution | trnd |
Univariate Discrete Distribution | unidrnd |
Uniform Distribution | unifrnd |
Weibull Distribution | wblrnd |
Wiener Process | wienrnd |
Return a matrix of random samples from the Beta distribution with parameters a and b.
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.
If no size arguments are given then the result matrix is the common size of a and b.
Return a matrix of random samples from the binomial distribution with parameters n and p, where n is the number of trials and p is the probability of success.
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.
If no size arguments are given then the result matrix is the common size of n and p.
Return a matrix of random samples from the Cauchy distribution with parameters location and scale.
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.
If no size arguments are given then the result matrix is the common size of location and scale.
Return a matrix of random samples from the chi-square distribution with n degrees of freedom.
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.
If no size arguments are given then the result matrix is the size of n.
Return a matrix of random samples from the univariate distribution which assumes the values in v with probabilities p.
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.
If no size arguments are given then the result matrix is the common size of v and p.
Return a matrix of random samples from the empirical distribution obtained from the univariate sample data.
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.
If no size arguments are given then the result matrix is a random ordering of the sample data.
Return a matrix of random samples from the exponential distribution with mean lambda.
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.
If no size arguments are given then the result matrix is the size of lambda.
Return a matrix of random samples from the F distribution with m and n degrees of freedom.
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.
If no size arguments are given then the result matrix is the common size of m and n.
Return a matrix of random samples from the Gamma distribution with shape parameter a and scale b.
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.
If no size arguments are given then the result matrix is the common size of a and b.
Return a matrix of random samples from the geometric distribution with parameter p.
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.
If no size arguments are given then the result matrix is the size of p.
The geometric distribution models the number of failures (x-1) of a Bernoulli trial with probability p before the first success (x).
Return a matrix of random samples from the hypergeometric distribution with parameters t, m, and n.
The parameters t, m, and n must be positive integers with m and n not greater than t.
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.
If no size arguments are given then the result matrix is the common size of t, m, and n.
Return a matrix of random samples from the Laplace distribution.
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.
Return a matrix of random samples from the logistic distribution.
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.
Return a matrix of random samples from the lognormal distribution with parameters mu and sigma.
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.
If no size arguments are given then the result matrix is the common size of mu and sigma.
Return a matrix of random samples from the negative binomial distribution with parameters n and p.
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.
If no size arguments are given then the result matrix is the common size of n and p.
Return a matrix of random samples from the normal distribution with parameters mean mu and standard deviation sigma.
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.
If no size arguments are given then the result matrix is the common size of mu and sigma.
Return a matrix of random samples from the Poisson distribution with parameter lambda.
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.
If no size arguments are given then the result matrix is the size of lambda.
Return a matrix of random samples from the standard normal distribution (mean = 0, standard deviation = 1).
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.
Return a matrix of random samples from the t (Student) distribution with n degrees of freedom.
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.
If no size arguments are given then the result matrix is the size of n.
Return a matrix of random samples from the discrete uniform distribution which assumes the integer values 1–n with equal probability.
n may be a scalar or a multi-dimensional array.
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.
If no size arguments are given then the result matrix is the size of n.
Return a matrix of random samples from the uniform distribution on [a, b].
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.
If no size arguments are given then the result matrix is the common size of a and b.
Return a matrix of random samples from the Weibull distribution with parameters scale and shape.
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.
If no size arguments are given then the result matrix is the common size of scale and shape.
Return a simulated realization of the d-dimensional Wiener Process on the interval [0, t].
If d is omitted, d = 1 is used. The first column of the return matrix contains time, the remaining columns contain the Wiener process.
The optional parameter n defines the number of summands used for simulating the process over an interval of length 1. If n is omitted, n = 1000 is used.
Previous: Tests, Up: Statistics [Contents][Index]