transitionProbability: Function to get the transition probabilities from initial to...

Description Usage Arguments Value Author(s) References See Also Examples

Description

This is a convenience function to get transition probabilities.

Usage

1
2
3
4
transitionProbability(object, t0, t1)

## S4 method for signature 'markovchain'
transitionProbability(object, t0, t1)

Arguments

object

A markovchain object.

t0

Initial state.

t1

Subsequent state.

Value

Numeric Vector

Author(s)

Giorgio Spedicato

References

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

See Also

markovchain

Examples

1
2
3
4
5
6
7
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" 
)    
transitionProbability(markovB,"b", "c")

markovchain documentation built on June 30, 2018, 5:01 p.m.