R/probabilistic.R
committorAB.Rd
Returns the probability of hitting states rom set A before set B with different initial states
committorAB(object,A,B,p)
object | a markovchain class object |
---|---|
A | a set of states |
B | a set of states |
p | initial state (default value : 1) |
Return a vector of probabilities in case initial state is not provided else returns a number
The function solves a system of linear equations to calculate probaility that the process hits a state from set A before any state from set B
transMatr <- matrix(c(0,0,0,1,0.5, 0.5,0,0,0,0, 0.5,0,0,0,0, 0,0.2,0.4,0,0, 0,0.8,0.6,0,0.5), nrow = 5) object <- new("markovchain", states=c("a","b","c","d","e"),transitionMatrix=transMatr) committorAB(object,c(5),c(3))#> a b c d e #> 0.4444444 0.8888889 0.0000000 0.4444444 1.0000000