commutation_matrix: Commutation matrix

Description Usage Arguments Examples

View source: R/optim_special_matrix.R

Description

Suppose A is a (r x c) matrix, then a (rc x rc) matrix K is a commutation matrix if K

Usage

1

Arguments

r

integer; row dimension.

c

integer; column dimension.

Examples

1
2
3
4
5
6
A <- randn(3, 4)
K <- commutation_matrix(3, 4)
compare <- function(x, y) {
    cbind(x, y, err = abs(x - y))
}
compare(K %*% vec(A), vec(t(A)))

ADtools documentation built on Nov. 9, 2020, 5:09 p.m.