mvnpdf: Multivariate Gaussian density

Description Usage Arguments Value Examples

View source: R/mvnpdf.R

Description

The function returns the density of the multivariate Gaussian density of size P for N replicates

Usage

1
2
mvnpdf(x, mean = rep(0, nrow(as.matrix(x))), varcovM = diag(1,
  nrow(as.matrix(x))), Log)

Arguments

x

PxN input matrix on which the density is computed with P the number of dimensions and N the number of observations

mean

mean vector (vector of size P)

varcovM

variance covariance matrix (matrix PxP)

Log

boolean indicating whether log value of the density should be returned

Value

a list with x matrix and the N contributions to the density

Examples

1
2
3
4
5
6
7
8
9
# example 1
m <- rep(0,10)
V <- diag(1,10)
x <- matrix(rnorm(50,0,1),nrow=10)
res <- mvnpdf(x,m,V,Log=FALSE)
# example 2
x <- 0.56
mvnpdf(x,0,1,Log=FALSE)
dnorm(x)

CecileProust-Lima/REDCecile documentation built on March 19, 2018, 4:08 a.m.