Learn R Programming

EMMIXskew (version 1.0.3)

ddmvn: The Multivariate Normal Distribution

Description

Density and random generation for Multivariate Normal distributions with mean vector mean, and covariance matrix cov.

Usage

ddmvn(dat,n, p, mean, cov)
rdmvn(    n, p, mean, cov)

Arguments

dat

An n by p numeric matrix, the dataset

n

An integer, the number of observations

p

An integer, the dimension of data

mean

A length of p vector, the mean

cov

A p by p matrix, the covariance

Value

ddmvn gives the density values; rdmvn generates the random numbers

See Also

rdemmix,ddmvt,ddmsn, ddmst,rdmvt,rdmsn, rdmst.

Examples

Run this code
# NOT RUN {
n <- 100
p <- 2

mean <- rep(0,p)
cov  <- diag(p)

set.seed(3214)

y <-   rdmvn(  n,p,mean,cov)

den <- ddmvn(y,n,p,mean,cov)

# }

Run the code above in your browser using DataLab