View source: R/dual-distributions.r
dnorm | R Documentation |
Density for the normal distribution, accepting objects of class 'dual'
dnorm(x, mean = 0, sd = 1, log = FALSE)
dnorm.dual(x, mean = 0, sd = 1, log = FALSE)
x |
vector of values |
mean |
vector of means |
sd |
vector of standard deviations |
log |
logical. If TRUE, log of densities are returned |
'dnorm.dual' will make straightfoward a computation (in R), that works both with numeric or dual objects. 'dnorm' will call 'dnorm.dual' if any of the objects is of class dual, or 'stats::dnorm' is all objects are of class numeric. As 'stats::dnorm' is in written in C it is factor.
If you care for performance, use 'stats::dnorm' directly for non dual numbers, and 'dnorm.dual' for dual numbers.
a dual object.
x <- dual(0)
dnx <- dnorm(x)
dnx
d(dnx)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.