Calculates probablities from the probability density function of the normal distribution \( X \sim \mathcal{N} \left( \mu, \sigma^2 \right) %(\#eq:dist-X-norm) \) . This function is identical to dnorm().

normpdf(x, mu = 0, sigma = 1, log = FALSE)

Arguments

x

Numeric vector. Values of the random variable \(X\).

mu

Numeric. Location parameter mean \(\mu\).

sigma

Numeric. Positive number. Scale parameter standard deviation \(\sigma = \sqrt{\sigma^2}\).

log

Logical. If TRUE, returns \(\log \left( f \left( x \right) \right)\).

Value

Returns \(f \left( x \right)\) using the probablity density function with the supplied parameter/s. If log = TRUE, returns \(\log \left( f \left( x \right) \right)\).

Details

The normal (or Gaussian or Gauss or Laplace–Gauss) distribution is given by $$ X \sim \mathcal{N} \left( \mu, \sigma^2 \right) %(\#eq:dist-X-norm) $$ and has the probability density function (PDF) $$ f \left( x \right) = \frac{1}{\sigma \sqrt{2 \pi}} \exp \left[ - \frac{1}{2} \left( \frac{x - \mu}{\sigma} \right)^2 \right] %(\#eq:dist-normpdf-1) $$ or $$ f \left( x \right) = \frac{1}{\sqrt{2 \pi \sigma^2}} \exp \left[ - \frac{ \left( x - \mu \right)^2} {2 \sigma^2} \right] %(\#eq:dist-normpdf-2) $$ with

  • \(x \in \mathbf{R}\),

  • \(\mu\) is the location parameter mean \(\left( \mu \in \mathbf{R} \right)\), and

  • \(\sigma^2\) is the scale parameter variance \(\left( \sigma^2 > 0 \right)\).

References

Wikipedia: Normal Distribution

See also

Other normal likelihood functions: norm2ll(), normL(), normll(), normobj()