matrix_normal {MBSP}R Documentation

Matrix-Normal Distribution

Description

This function provides a way to draw a sample from the matrix-normal distribution, given the mean matrix, the covariance structure of the rows, and the covariance structure of the columns.

Usage

matrix_normal(M, U, V)

Arguments

M

mean a×ba \times b matrix

U

a×aa \times a covariance matrix (covariance of rows).

V

b×bb \times b covariance matrix (covariance of columns).

Details

This function provides a way to draw a random a×ba \times b matrix from the matrix-normal distribution,

MN(M,U,V),MN(M, U, V),

where MM is the a×ba \times b mean matrix, UU is an a×aa \times a covariance matrix, and VV is a b×bb \times b covariance matrix.

Value

A randomly drawn a×ba \times b matrix from MN(M,U,V)MN(M,U,V).

Author(s)

Ray Bai and Malay Ghosh

Examples


# Draw a random 50x20 matrix from MN(O,U,V),
# where:
#    O = zero matrix of dimension 50x20
#    U has AR(1) structure,
#    V has sigma^2*I structure

# Specify Mean.mat
p <- 50
q <- 20
Mean_mat <- matrix(0, nrow=p, ncol=q)

# Construct U
rho <- 0.5
times <- 1:p
H <- abs(outer(times, times, "-"))
U <- rho^H

# Construct V
sigma_sq <- 2
V <- sigma_sq*diag(q)

# Draw from MN(Mean_mat, U, V)
mn_draw <- matrix_normal(Mean_mat, U, V)

[Package MBSP version 4.0 Index]