we met with interesting problem of R. We wanted to find 100 degree of any given markov chain matrix. The problem is that after some time matrix suddenly goes to zero. We think that is causation of approximately of matrix multiplication. Do you have any ideas how to fix it?
a <- c(0.2, 0, 0.7, 0.1)
b <- c(0.5, 0.2, 0.2, 0.1)
c <- c(0, 0.3, 0.7, 0)
d <- c(0.1, 0.8, 0, 0.1)
mat <- matrix(c(a,b,c,d), ncol=4, byrow=TRUE)
z <- mat
for(i in 1:100)
{
print(i)
z <- z%*%z
print(z)
}