# example of a case where "full conditionals" do not give a # consistant limit dist: # states 00 0 01 1 10 2 11 3 P1_matrix(scan(),ncol=4,byrow=T) .4 0 .6 0 0 .2 0 .8 .4 0 .6 0 0 .2 0 .8 P2_matrix(scan(),ncol=4,byrow=T) .3 .7 0 0 .3 .7 0 0 0 0 .2 .8 0 0 .2 .8 matpower_ function(P, pow) { if(pow == 1) return(P) else return(P %*% matpower(P, pow - 1)) } P12_P1%*%P2 P21_P2%*%P1 options(expressions=1000) matpower(P12,30) [1,] 0.07346939 0.1714286 0.1510204 0.6040816 [2,] 0.07346939 0.1714286 0.1510204 0.6040816 [3,] 0.07346939 0.1714286 0.1510204 0.6040816 [4,] 0.07346939 0.1714286 0.1510204 0.6040816 matpower(P21,30) [1,] 0.08979592 0.155102 0.1346939 0.6204082 [2,] 0.08979592 0.155102 0.1346939 0.6204082 [3,] 0.08979592 0.155102 0.1346939 0.6204082 [4,] 0.08979592 0.155102 0.1346939 0.6204082