krp: Function to compute Khatri-Rao product

Description Usage Arguments Value Note Author(s) References Examples

View source: R/krp.R

Description

The function krp(A,B) returns the Khatri-Rao product of two matrices A and B, of dimensions I x K and J x K respectively. The result is an IJ x K matrix formed by the matching column-wise Kronecker products, i.e. the k-th column of the Khatri-Rao product is defined as kronecker(A[, k], B[, k]).

Usage

1
krp(A, B)

Arguments

A

Matrix of order I x K.

B

Matrix of order J x K.

Value

The IJ x K matrix of columnwise Kronecker products.

Note

A and B must have the same number of columns.

Author(s)

Valentin Todorov [email protected]

References

Khatri, C.G. and Radhakrishna Rao, C. (1968). Solutions to Some Functional Equations and Their Applications to Characterization of Probability Distributions. Sankhya: Indian J. Statistics (Series A), 30:167-180. Smilde, A., Bro R. and Gelardi, P. (2004). Multi-way Analysis: Applications in Chemical Sciences, Chichester:Wiley

Examples

1
2
3
4
5
6
7
A <- matrix(1, nrow=5, ncol=2)
B <- matrix(1:4, ncol=2)
krp(A,B)

A <- matrix(1:10, ncol=2, byrow=TRUE)
B <- diag(1,2)
krp(A,B)

rrcov3way documentation built on June 23, 2017, 4:45 a.m.

Related to krp in rrcov3way...