
Last chance! 50% off unlimited learning
Sale ends in
Computes the kronecker product of two matrices, x
and y
.
kronecker.prod(x, y = x)
An array with dimensions dim(x) * dim(y)
.
a numeric matrix or vector.
a numeric matrix or vector.
Let
Magnus, J.R., Neudecker, H. (2007). Matrix Differential Calculus with Applications in Statistics and Econometrics, 3rd Edition. Wiley, New York.
# block diagonal matrix:
a <- diag(1:3)
b <- matrix(1:4, ncol = 2)
kronecker.prod(a, b)
# examples with vectors
ones <- rep(1, 4)
y <- 1:3
kronecker.prod(ones, y) # 12-dimensional vector
kronecker.prod(ones, t(y)) # 3 x 3 matrix
Run the code above in your browser using DataLab