committorAB: Calculates committor of a markovchain object with respect to...

View source: R/probabilistic.R

committorABR Documentation

Calculates committor of a markovchain object with respect to set A, B

Description

Returns the probability of hitting states rom set A before set B with different initial states

Usage

committorAB(object,A,B,p)

Arguments

object

a markovchain class object

A

a set of states

B

a set of states

p

initial state (default value : 1)

Details

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

Value

Return a vector of probabilities in case initial state is not provided else returns a number

Examples

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))


spedygiorgio/markovchain documentation built on Feb. 29, 2024, 3:01 p.m.