R: Defined states of a transition matrix

states {markovchain} | R Documentation

## Defined states of a transition matrix

### Description

This method returns the states of a transition matrix.

### Usage

    states(object)

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

### Arguments

`object` | A discrete `markovchain` object

### Value

The character vector corresponding to states slot.

### Author(s)

Giorgio Spedicato

### References

A First Course in Probability (8th Edition), Sheldon Ross, Prentice Hall 2010

### See Also

`markovchain`

### 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)),
                    name = "A markovchain Object"
    )
    states(markovB)
    names(markovB)

[Package markovchain version 0.8.6 Index]