# dGaussian: Density function of Gaussian distribution In bbricks: Bayesian Methods and Graphical Model Structures for Statistical Modeling

## Description

Get the density of a set of samples from a (multivariate) Gaussian distribution. For a random vector x, the density function is defined as:

sqrt(2 pi^p |Sigma|)^{-1} exp(-1/2 (x-mu )^T Sigma^{-1} (x-mu))

where p is the dimension of x.

## Usage

 `1` ```dGaussian(x, mu, Sigma = NULL, A = NULL, LOG = TRUE) ```

## Arguments

 `x` matrix, when x is a numeric vector, it will be converted to a matrix with 1 column! `mu` numeric, mean vector. `Sigma` matrix, covariance matrix, one of Sigma and A should be non-NULL. `A` matrix, the Cholesky decomposition of Sigma, an upper triangular matrix, one of Sigma and A should be non-NULL. `LOG` logical, return log density of LOG=TRUE, default TRUE.

## Value

A numeric vector.

`rGaussian`
 ```1 2 3 4``` ```plot( dGaussian(x=seq(-5,5,length.out = 1000),mu = 0,Sigma = 1,LOG = FALSE) ,type = "l" ) ```