Learn R Programming

vocaldia (version 0.8.4)

staticMatrix: staticMatrix Iterate until transition probabilities converge (or give up).

Description

Compute the stationary distribution for a Markov diagram

Usage

staticMatrix(matrix, limit = 1000, digits = 4, history = F)

Value

a matrixseries object; that is, a list where each element is either the initial matrix or the product of the two preceding matrices

Arguments

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

Details

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 |

Examples

Run this code
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)

Run the code above in your browser using DataLab