gNormalPrior creates the gradient function of a multivariate normal distribution with independent components, in log-space
gNormalPrior.RdThe returned density function takes vectors of the same size as mean and sd.
It returns the gradient of the logarithm of the multivariate normal distribution,
with mean mean and standard deviation sd.
Arguments
- mean
mean of the random variables (a vector)
- sd
standard deviation of the random variables (same size vector as mean)
Examples
dnp <- dNormalPrior(mean=c(0,1,2),sd=c(1,2,3))
dnp(c(0.5,1.5,2.5))
#> [1] 0.008926651