Stata 15 help for mf_Kmatrix

[M-5] Kmatrix() -- Commutation matrix

Syntax

real matrix Kmatrix(real scalar m, real scalar n)

Description

Kmatrix(m, n) returns the mn x mn commutation matrix K for which K*vec(X) = vec(X'), where X is an m x n matrix.

Remarks

Commutation matrices are frequently used in computing derivatives of functions of matrices. Section 9.2 of L├╝tkepohl (1996) lists many useful properties of commutation matrices.

Conformability

Kmatrix(m, n): m: 1 x 1 n: 1 x 1 result: mn x mn

Diagnostics

Kmatrix(m, n) aborts with error if either m or n is less than 0 or is missing. m and n are interpreted as trunc(m) and trunc(n).

Source code

kmatrix.mata

Reference

L├╝tkepohl, H. 1996. Handbook of Matrices. New York: Wiley.


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index