staticMatrix | R Documentation |
Compute the stationary distribution for a Markov diagram
staticMatrix(matrix, limit = 1000, digits = 4, history = F)
matrix |
an adjecency matrix of trnasition probabilities |
limit |
maximum number of iterations until we give up on convergence |
digits |
the number of decimal places to compare |
history |
if TRUE, keep track of all matrix products |
Return static matrix (i.e. the stationary distribution) for the Markov process represented by the given adjacency matrix. In the particular case of vocaldia's, each column should roughly correspond to the amount of time a speaker held the floor for). Of course, not all Markov chains converge, an example being:
1 /----->-------\ A B \----<--------/ 1 which gives . | 0 1 | | 0x0+1x1 0x1+1x0| | 1 0 | . M = | 1 0 | and M^2 = | 1x0+0x1 1x1+1x0| = | 0 1 |
a matrixseries object; that is, a list where each element is either the initial matrix or the product of the two preceding matrices
data(vocdia) x2 <- staticMatrix(vocmatrix$ttarray, digits=4, history=TRUE) ## original matrix round(x2[[1]],3) ## stationary matrix (M^139) round(x2[[length(x2)]],3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.