A <- rbind(c(0,0,0,0,127,4,80), c(.6747,.737,0,0,0,0,0), c(0,.0486,.661,0,0,0,0), c(0,0,.0147,.6907,0,0,0), c(0,0,0,.0518,0,0,0), c(0,0,0,0,.8091,0,0), c(0,0,0,0,0,.8091,.8089)) # the matrix power function matrix.power <- function(n, A) { out <- A for (i in 1:(n-1)) out <- out %*% A return(out) } matrix.power(2, A) matrix.power(3, A) matrix.power(4, A) matrix.power(5, A) matrix.power(6, A) matrix.power(37, A)