Programmer Guide/Command Reference/EVAL/grand: Difference between revisions

From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import)
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
=====grand=====
Generation of gaussian distributed pseudo random numbers.


{|
;Usage: '''<code>rand(''m'' {, ''s'' {, ''seed'' {, ''nr'' {, ''nc''}}}})</code>'''
|-
:;''m'': mean value of the gaussian distribution
|grand(m, <var>s</var>)
:;''s'': standard deviation of the gaussian distibution (default=1)
|Create a normal distributed random number with the mean m and spread <var>s</var>.
:;''seed'': if this value is not equal ''0'', it is used to initialize the random number generator (default=0)
|-
:;''nr'': number of rows of the result (default=1)
|grand(m, <var>s</var>, <var>seed</var>)
:;''nc'': number of columns of the result (default=1)
|Like grand, except if seed is greater than zero, it is used as the start value to initialise the generator.
;Result 2: A numeric object ''r'' with ''nr'' rows and ''nc'' columns. Each element of ''r'' is set to a gaussian distibuted pseudo random number with mean ''m'' and standard deviation ''s''.
|-
|grand(m, <var>s</var>, <var>seed</var>, <var>nr</var>, <var>nc</var>)
|Create a vector or a matrix of normal distributed random numbers with a mean m and a spread <var>s</var>.{|
|-
|<var>seed</var>
|the start value (if seed > 0)
|-
|nr
|the number of rows or elements (>=1; def.=1)
|-
|nc
|the number of columns (>=1; def.=1)
|}


;See also: [[Programmer_Guide/Command_Reference/EVAL/rand|rand]], [[Programmer_Guide/Command_Reference/EVAL/sample|sample]], [[Programmer_Guide/Command_Reference/EVAL/shuffle|shuffle]]
|}
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Revision as of 16:37, 8 April 2011

Generation of gaussian distributed pseudo random numbers.

Usage
rand(m {, s {, seed {, nr {, nc}}}})
m
mean value of the gaussian distribution
s
standard deviation of the gaussian distibution (default=1)
seed
if this value is not equal 0, it is used to initialize the random number generator (default=0)
nr
number of rows of the result (default=1)
nc
number of columns of the result (default=1)
Result 2
A numeric object r with nr rows and nc columns. Each element of r is set to a gaussian distibuted pseudo random number with mean m and standard deviation s.
See also
rand, sample, shuffle

<function list>

Navigation menu

Personal tools