17 Type
dnorm(Type x, Type mean, Type sd,
int give_log=0)
19 Type resid = (x - mean) / sd;
20 Type logans = Type(-log(sqrt(2*M_PI))) - log(sd) - Type(.5) * resid * resid;
21 if(give_log)
return logans;
else return exp(logans);
Type dnorm(Type x, Type mean, Type sd, int give_log=0)
Probability density function of the normal distribution.
#define VECTORIZE4_ttti(FUN)
Vectorize 4-argument functions.