Skip to content
This repository was archived by the owner on May 21, 2020. It is now read-only.
Florian Rappl edited this page Dec 21, 2014 · 2 revisions

randg

Generates a matrix with gamma distributed random values. In probability theory and statistics, the gamma distribution is a two-parameter family of continuous probability distributions.

References

randg()

Generates one gamma distributed random value with theta and k set to 1.

Returns 1. entry

Scalar

Example

randg()

Outputs a scalar that has been generated with respect to the distribution.

randg(dim)

Generates a n-by-n matrix with gamma distributed random values with theta and k set to 1.

Argument dim

Scalar

Returns 1. entry

Matrix

Example

randg(3)

Gives a 3x3 matrix with gamma dist. rand. values.

randg(rows,cols)

Generates a m-by-n matrix with gamma distributed random values with theta and k set to 1.

Argument rows

Scalar

Argument cols

Scalar

Returns 1. entry

Matrix

Example

randg(3, 1)

Gives a 3x1 matrix with gamma dist. rand. values.

randg(rows,cols,theta,k)

Generates a m-by-n matrix with gamma distributed random values with a custom theta (scale) and k (shape) parameter.

Argument rows

Scalar

Argument cols

Scalar

Argument theta

Scalar

Argument k

Scalar

Returns 1. entry

Matrix

Example

randg(3, 1, 10, 2.5)

Gives a 3x1 matrix with gamma dist. rand. values around 10 with scale parameter theta set to 10 and shape parameter k set to 2.5.

Clone this wiki locally