Various function to perform structural analysis of DTMC

Share:

Description

These functions return absorbing and transient states of the markovchain objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
absorbingStates(object)

transientStates(object)

## S4 method for signature 'markovchain'
transientStates(object)

canonicForm(object)

communicatingClasses(object)

recurrentClasses(object)

period(object)

Arguments

object

A markovchain object.

Value

vector, matrix or list

Author(s)

Giorgio Alfredo Spedicato

References

Feres, Matlab listing for markov chain.

See Also

markovchain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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)
              ))
              
communicatingClasses(markovB)               
recurrentClasses(markovB)
absorbingStates(markovB)
transientStates(markovB)
canonicForm(markovB)

# periodicity analysis : 1
E <- matrix(c(0, 1, 0, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0, 0.5, 0, 0, 1, 0), 
            nrow = 4, ncol = 4, byrow = TRUE)
mcE <- new("markovchain", states = c("a", "b", "c", "d"), 
          transitionMatrix = E, 
          name = "E")

is.irreducible(mcE) #true
period(mcE) #2

# periodicity analysis : 2
myMatr <- matrix(c(0, 0, 1/2, 1/4, 1/4, 0, 0,
                   0, 0, 1/3, 0, 2/3, 0, 0,
                   0, 0, 0, 0, 0, 1/3, 2/3,
                   0, 0, 0, 0, 0, 1/2, 1/2,
                   0, 0, 0, 0, 0, 3/4, 1/4,
                   1/2, 1/2, 0, 0, 0, 0, 0,
                   1/4, 3/4, 0, 0, 0, 0, 0), byrow = TRUE, ncol = 7)
myMc <- new("markovchain", transitionMatrix = myMatr)
period(myMc)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.