Kronecker Products

DESCRIPTION:

Returns a matrix with dimension the product of the dimensions of the input matrices. Each element of the first matrix is replaced by that element times the second matrix.

USAGE:

kronecker(a, b, fun="*") 

REQUIRED ARGUMENTS:

a,b
matrices, either numeric or complex.

OPTIONAL ARGUMENTS:

fun
name of the function that operates on the elements of the matrices. This function (or operator) must return a vector the same length as the input.

VALUE:

matrix of dimension dim(a) * dim(b). Each block of size dim(b) in the answer is fun of the element of a which corresponds to the block with the matrix b.

BACKGROUND:

Kronecker products are often used in multivariate statistics.

SEE ALSO:

, , .

EXAMPLES:

kronecker(matrix(1:6,3,2), diag(2))