Library: | VaR |
See also: | VaRRatMigRate VaRRatMigRateM conting VaRcredN |
Quantlet: | VaRRatMigCount | |
Description: | Derives the matrix of migration counts from the matrix of migration events |
Usage: | counts = VaRRatMigCount (d,e) | |
Input: | ||
d | scalar, number of categories (incl. default) | |
e | n x 2 matrix of migration events. Each row of the matrix corresponds to an event - migration from state i to state j. | |
Output: | ||
counts | d-1 x d matrix containing counts of migrations, i.e., the (i,j)-th element of the matrix contains the number of migrations from state i to state j. |
library("VaR") e=#(1,1,1,1,2,2,1,1,2,2,2)~#(1,1,1,2,3,2,3,2,2,3,2) counts=VaRRatMigCount(3,e) counts
Contents of counts [1,] 3 2 1 [2,] 0 3 2