Description Usage Arguments Details Value Author(s) Examples
View source: R/matrix.normal.R
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.
1 | matrix.normal(M, U, V)
|
M |
mean a \times b matrix |
U |
a \times a covariance matrix (covariance of rows). |
V |
b \times b covariance matrix (covariance of columns). |
This function provides a way to draw a random a \times b matrix from the matrix-normal distribution,
MN(M, U, V),
where M is the a \times b mean matrix, U is an a \times a covariance matrix, and V is a b \times b covariance matrix.
A randomly drawn a \times b matrix from MN(M,U,V).
Ray Bai and Malay Ghosh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.