Learn R Programming

markovchain (version 0.0.1)

markovchainFit: Function to fit a discrete Markov chain

Description

Given a sequence of states arising from a stationary state, it fits the underlying markov chain distribution using a frequentist approach.

Usage

markovchainFit(data, byrow = TRUE)

Arguments

data
A character list.
byrow
it tells whether the output markov chain should show the transition probabilities by row.

Value

  • A markovchain object

Warning

This function will probably be modified in the future

References

Sheldon Ross, Probability Models.

See Also

markovchainSequence

Examples

Run this code
sequence<-c("a", "b", "a", "a", "a", "a", "b", "a", "b", "a", "b", "a", "a", 
"b", "b", "b", "a")
mcFit<-markovchainFit(data=sequence)

Run the code above in your browser using DataLab