states <- c("a", "b", "absorbed")
mc <- new("markovchain", states = states,
transitionMatrix = matrix(c(
0.5, 0.4, 0.1,
0.2, 0.6, 0.2,
0, 0, 1
), nrow = 3, byrow = TRUE,
dimnames = list(states, states)))
fundamentalMatrix(mc)
Run the code above in your browser using DataLab