Skip to contents

Checks whether state to is accessible from state from, i.e. whether the chain started in from reaches to with positive probability in some number of steps.

Usage

is.accessible(object, from, to)

Arguments

object

A markovchain object.

from

Name of the starting state.

to

Name of the target state.

Value

TRUE if to is accessible from from, FALSE otherwise.

References

James Montgomery, University of Madison

Author

Giorgio Spedicato, Ignacio Cordón

Examples

statesNames <- c("a", "b", "c")
markovB <- new("markovchain", states = statesNames, 
               transitionMatrix = matrix(c(0.2, 0.5, 0.3,
                                             0,   1,   0,
                                           0.1, 0.8, 0.1), nrow = 3, byrow = TRUE, 
                                         dimnames = list(statesNames, statesNames)
                                        )
               )
is.accessible(markovB, "a", "c")
#> [1] TRUE