Command Reference : Function Reference : Function Reference: D
  
 
@dmvnorm
Multivariate normal probability density.
Syntax: @dmvnorm(x, S)
@dmvnormc(x, S)
@dmvnormi(x, S)
@dmvnormic(x, S)
x: vector
S: sym, matrix
Return: number
Evaluate the multivariate normal density function for vector values of x, and sym .
The mean zero multivariate normal density is given by
There are four different forms of the density evaluation function, corresponding to different ways of specifying . The forms are distinguished by different suffixes that are applied to the base “@dmvnorm” command and how they change the interpretation of the S matrix argument:
 
@dmvnorm
“”
Supply .
@dmvnormc
“c”
Supply the Cholesky decomposition of .
This form is more efficient when performing multiple draws from the same distribution (compute the Cholesky once, but sample many times).
@dmvnormi
“i”
Supply .
This form is more efficient than explicitly inverting to supply .
@dmvnormic
“ic”
Supply the Cholesky decomposition of .
This form combines the efficiencies of the Cholesky and inverse forms.
Examples
= @dmvnorm(@zeros(3), @identity(3))
returns 0.06349....
Cross-references
See also @rmvnorm.