Learn R Programming

markovchain (version 0.0.2)

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, method="mle", byrow = TRUE)

Arguments

data
A character list.
method
Method used to estimate the markov chain. Currently, only "mle" (maximum likelihood) is implemented.
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