Learn R Programming

SuperPCA (version 0.4.0)

kr: Compute a string of Khatri-Rao products

Description

The function compute a string of Khatri-Rao products. A*B*C*..., "*" denotes the Khatri-Rao product. If the list only contains two matrices, kr() return the Khatri-Rao product of two matrices.

Usage

kr(x)

Arguments

x

a list of matrices

Value

result of a string of Khatri-Rao products

Examples

Run this code
# NOT RUN {
#ex1
m1 <- matrix(1:9,3,3)
m2 <- matrix(1:12,4,3)
m3 <- matrix(13:27,5,3)
l1 <- list(m1,m2,m3)
kr(l1)
#ex2
l2 <- list(m1,m3)
kr(l2)
# }

Run the code above in your browser using DataLab