dnorm(x, mean=0, sd=1, log=F) pnorm(q, mean=0, sd=1, lower.tail=TRUE, log.p=FALSE) qnorm(p, mean=0, sd=1) rnorm(n, mean=0, sd=1, bigdata=F)
bdVector
of quantiles.
Missing values (
NA
s) are allowed.
bdVector
of quantiles.
Missing values (
NA
s) are allowed.
bdVector
of probabilities.
Missing values (
NA
s) are allowed.
length(n)
is larger than 1,
then
length(n)
random values are returned.
bdVector
of means.
This is replicated to be the same length as
p
or
q
or the number of deviates generated.
bdVector
of (positive) standard deviations.
This is replicated to be the same length as
p
or
q
or the number of deviates generated.
TRUE
, an object of type
bdVector
is returned.
Otherwise, a
vector
object is returned. This argument can be used only if the bigdata library section has been loaded.
TRUE
,
dnorm
will return
the log of the density, not the density itself.
P[X <= x]
, otherwise,
P[X > x]
.
TRUE
, probabilities
p
are given as
log(p)
. Default is
FALSE
.
dnorm
),
probability (
pnorm
),
quantile (
qnorm
), or
random sample (
rnorm
)
for the normal distribution with mean and standard deviation
parameters
mean
and
sd
.
rnorm
causes creation
of the dataset
.Random.seed
if it does
not already exist,
otherwise its value is updated.
Elements of
q
or
p
that are missing will cause the corresponding
elements of the result to be missing.
The ratio of uniform deviates is used by
rnorm
to generate normal deviates (Kinderman and Monahan, 1977).
The average number of uniform deviates used per normal deviate is
8/sqrt(exp(1)*pi)
which is about 2.74.
The Gaussian or normal distribution is the most widely used in Statistics.
It is real valued and symmetric about
mean
.
There are two major reasons for the dominance of the Gaussian distribution.
The first is that the mathematics tend to be relatively simple,
and the second is that often the random mechanism can be specified
as approximately Gaussian due to the Central Limit Theorem.
The simplest Central Limit Theorem states that
the average of independent and identically distributed random variables
whose variances exist approaches the Gaussian distribution as the
number of random variables in the average goes to infinity.
The result can still be true when these assumptions are
loosened in various ways.
For details on the uniform random number generator implemented in S-PLUS,
see the
set.seed
help file.
Johnson, N. L. and Kotz, S. (1970). Continuous Univariate Distributions, vol. 1. Houghton-Mifflin, Boston.
Kinderman, A. J. and Monahan, J. F. (1977). Computer generation of random variables using the ratio of uniform deviates. ACM Transactions on Mathematical Software. 3 257-260.
rnorm(20, 0, 10) # sample of 20, mean 0, standard dev. 10 # Generate a 20x5 matrix of independent Gaussians: matrix(rnorm(20*5), nrow=20) # one way rmvnorm(20, d=5) # another