rmatnorm: Matrix normal distribution

Description Usage Arguments Value See Also Examples

Description

The function provide a random number generator for the Matrix normal distribution vec(X) ~ N(vec(M), kron(sigmaT, sigmaS)).

Usage

1
rmatnorm(n, mean = matrix(0, nrow = nrow(sigmaS), ncol = ncol(sigmaT)), sigmaS, sigmaT, method = c("eigen", "svd", "chol"))

Arguments

n

number of observations.

mean

mean matrix, default is matrix(0, nrow=nrow(sigmaS), ncol=ncol(sigmaT)).

sigmaS

covariance matrix between rows.

sigmaT

covariance matrix between columns.

method

string specifying the matrix decomposition used todetermine the matrix root of sigmaS and sigmaT. Possible methods are eigenvalue decomposition ("eigen", default), singular value decomposition ("svd"), and Cholesky decomposition ("chol").

Value

returns a p*q*n array if n > 1. returns a p*q matrix if n = 1.

See Also

rmatdata

Examples

1
2
3
4
5
p <- 5; q <- 6; n <- 10
set.seed(1212)
s1 <- 0.5^abs(outer(1:p,1:p,"-"))
s2 <- 0.4^abs(outer(1:q,1:q,"-"))
x <- rmatnorm(n,mean=matrix(1,p,q),sigmaS=s1,sigmaT=s2)

jijiadong/MVDN documentation built on Sept. 6, 2020, 7:15 p.m.