Library: | finance |
See also: | IBTdk IBTbc IBTnicemat |
Quantlet: | IBTresort | |
Description: | generates a new matrix using the upper part of the input matrix |
Usage: | T = IBTresort(matr) | |
Input: | ||
matr | Matrix: upper triangular matrix, the number of the rows is equal to the number of the columns | |
Output: | ||
T | Matrix: (2*rows(matr)-1)*rows(matr) matrix, the non-zero elements in T corresponding to the different elements in matr, others are 0 |
library("finance") matr=#(1,0,0)~#(2,3,0)~#(4,5,6) T=IBTresort(matr) matr T
Output is a 5*3 matrix T Contents of matr [1,] 1 2 4 [2,] 0 3 5 [3,] 0 0 6 Contents of T [1,] 0 0 6 [2,] 0 3 0 [3,] 1 0 5 [4,] 0 2 0 [5,] 0 0 4