R/dmunorm.R

Defines functions dmunorm

Documented in dmunorm

dmunorm=function(x,mu,sig,log=FALSE){
#density of the multivariate Gaussian

vale=-.5*((x-mu)%*%solve(sig)%*%(x-mu)+log(det(sig))+length(x)*log(2*pi))
if (!log) vale=exp(vale)

vale
}

Try the mcsm package in your browser

Any scripts or data that you put into this service are public.

mcsm documentation built on May 30, 2017, 1:33 a.m.