crossprodV | R Documentation |
Vectorized matrix cross-products t(X) V Y
or t(X) V^{-1} Y
.
crossprodV(X, Y = NULL, V, inverse = FALSE)
X |
A matrix of size |
Y |
A matrix of size |
V |
A matrix of size |
inverse |
Logical; whether or not the inner product should be calculated with |
An array of size q x r x n
.
# problem dimensions p <- 4 q <- 2 r <- 3 n <- 5 X <- array(rnorm(p*q*n), dim = c(p, q, n)) # vectorized Y <- array(rnorm(p*r*n), dim = c(p, r, n)) # vectorized V <- crossprod(matrix(rnorm(p*p), p, p)) # not vectorized (but positive definite) crossprodV(X = X, V = V) # self cross-product # cross-product with inverse matrix weight crossprodV(X = X, V = V, Y = Y, inverse = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.