Rev Language Reference


dnNormal - Normal Distribution

Normal (gaussian) distribution with mean equal to ‘mean’ and standard deviation equal to ‘sd’.

Aliases

  • dnNorm

Usage

dnNormal(Real mean, RealPos sd)

Arguments

mean : Real (pass by const reference)
The mean parameter.
Default : 0
sd : RealPos (pass by const reference)
The standard deviation parameter.
Default : 1

Domain Type

Details

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.

Example

# we simulate some observations
x <- rnorm(n=10,mean=5,sd=10)
# let's see what the minimum is (you could do the max too)
min(x)
# let's also see what the mean and the variance are
mean(x)
var(x)
sd(x)

See Also