Ciao,
io scrivo il codice in R. Un ambiente di sviluppo OPEN SOURCE, dal quale è derivato S-PLUS. Per intenderci simile a Matlab ma + statistico.
Di seguito le specifiche del comando rnorm (attenzione, funziona solo per campioni Normali)
The Normal Distribution
Description:
Density, distribution function, quantile function and random
generation for the normal distribution with mean equal to 'mean'
and standard deviation equal to 'sd'.
Usage:
dnorm(x, mean=0, sd=1, log = FALSE)
pnorm(q, mean=0, sd=1, lower.tail = TRUE, log.p = FALSE)
qnorm(p, mean=0, sd=1, lower.tail = TRUE, log.p = FALSE)
rnorm(n, mean=0, sd=1)
Arguments:
x,q: vector of quantiles.
p: vector of probabilities.
n: number of observations. If 'length

> 1', the length is
taken to be the number required.
mean: vector of means.
sd: vector of standard deviations.
log, log.p: logical; if TRUE, probabilities p are given as log(p).
lower.tail: logical; if TRUE (default), probabilities are P[X <= x],
otherwise, P[X > x].
Details:
If 'mean' or 'sd' are not specified they assume the default values
of '0' and '1', respectively.
The normal distribution has density
f(x) = 1/(sqrt(2 pi) sigma) e^-((x - mu)^2/(2 sigma^2))
where mu is the mean of the distribution and sigma the standard
deviation.
'qnorm' is based on Wichura's algorithm AS 241 which provides
precise results up to about 16 digits.
Value:
'dnorm' gives the density, 'pnorm' gives the distribution
function, 'qnorm' gives the quantile function, and 'rnorm'
generates random deviates.
Source:
For 'pnorm', based on
Cody, W. D. (1993) Algorithm 715: SPECFUN - A portable FORTRAN
package of special function routines and test drivers. _ACM
Transactions on Mathematical Software_ *19*, 22-32.
For 'qnorm', the code is a C translation of
Wichura, M. J. (1988) Algorithm AS 241: The Percentage Points of
the Normal Distribution. _Applied Statistics_, *37*, 477-484.
For 'rnorm', see RNG for how to select the algorithm and for
references to the supplied methods.