Learn R Programming

markovchain (version 0.0.2)

markovchain-class: Class "markovchain"

Description

The S4 class that describes markovchain objects.

Arguments

Objects from the Class

Objects can be created by calls of the form new("markovchain", states, byrow, transitionMatrix, ...).

Warning

Validation method is used to assess whether either columns or rows totals to one. Rounding is used up to 5th decimal

References

Introduction to Probability Models, Sheldon Ross

See Also

markovchainSequence,markovchainFit

Examples

Run this code
#show markov chain definition
showClass("markovchain")
#create a simple markov chains
simpleMc<-new("markovchain", states=c("a","b"),
transitionMatrix=matrix(c(0.4,0.6,.3,.7),nrow=2,byrow=TRUE))
#power
simpleMc^4
#some methods
steadyStates(simpleMc)

Run the code above in your browser using DataLab