mxnorm: Matrix Variate Normal Distribution

Description Usage Arguments Examples

Description

Functions dmxnorm and rmxnorm are for evaluating densities and generating random samples from corresponding matrix variate normal distribution.

Usage

1
2
3
4
dmxnorm(X, M = array(0, c(p, n)), U = diag(nrow(M)), V = diag(ncol(M)),
  log = FALSE)

rmxnorm(n, M, U = diag(nrow(M)), V = diag(ncol(M)))

Arguments

X

a (p-by-n) matrix whose density be computed.

M

a (p-by-n) mean matrix.

U

a (p-by-p) left scale matrix.

V

an (n-by-n) right scale matrix.

log

a logical; TRUE to return log density, FALSE otherwise.

n

the number of samples to be generated.

Examples

1
2
3
4
5
6
7
8
## generate 1000 samples from {M,U,V = diag()}
samples1000= rmxnorm(1000, diag(3))

## test for LLN : taking average of 1000 samples
average1000 = apply(samples1000, c(1,2), mean)

## evaluate the density for average matrix
density1000 = dmxnorm(average1000, diag(3))

matdist documentation built on Dec. 8, 2017, 1:05 a.m.

Related to mxnorm in matdist...