#For LUCC library(expm) library(pracma) library(diagram) stateNames <- c("vegetation","water","builtup") Oz <- matrix(c(0.21, 0.03, 0.76,.25, 0.05, .7, .33, .04, 0.63), nrow=3, byrow= TRUE) row.names(Oz) <- stateNames; colnames(Oz) <- stateNames Oz plotmat(Oz, pos = c(1,2), lwd=1, box.lwd=2, cex.txt = 0.8,box.size = 0.1, box.type = "circle", box.prop = 0.5, box.col = "light blue", arr.length = . 1, arr.width = .1, self.cex = .4, self.shifty = -.01, self.shiftx = .13, main = "") x1 <-matrix(c(0,1,0), nrow=1, byrow=TRUE) x1 %*% Oz Oz5 <- Oz %^% 5 Oz5=round(Oz5,3) plotmat(Oz5, pos = c(1,2), lwd=1, box.lwd=2, cex.txt = 0.8,box.size = 0.12, box.type = "circle", box.prop = 0.7, box.col = "light blue", arr.length = . 2, arr.width = .1, self.cex = .6, self.shifty = -.01, self.shiftx = .17, main = "Markov Chain Transition Matrix") round(x1 %*% Oz5,3) ##For LST stateNames <- c("vegetation","water","builtup") Oz <- matrix(c(0.296, 0.362, 0.342, 0.326, 0.313, 0.361, 0.327, 0.322, 0.351), nrow=3, byrow= TRUE) row.names(Oz) <- stateNames; colnames(Oz) <- stateNames Oz plotmat(Oz, pos = c(1,2), lwd=1, box.lwd=2, cex.txt = 0.8,box.size = 0.1, box.type = "circle", box.prop = 0.5, box.col = "light blue", arr.length = . 1, arr.width = .1, self.cex = .4, self.shifty = -.01, self.shiftx = .13, main = "") x1 <-matrix(c(0,1,0), nrow=1, byrow=TRUE) x1 %*% Oz Oz5 <- Oz %^% 5 Oz5=round(Oz5,3) plotmat(Oz5, pos = c(1,2), lwd=1, box.lwd=2, cex.txt = 0.8,box.size = 0.12, box.type = "circle", box.prop = 0.7, box.col = "light blue", arr.length = . 2, arr.width = .1, self.cex = .6, self.shifty = -.01, self.shiftx = .17, main = "Markov Chain Transition Matrix") round(x1 %*% Oz5,3)