Learn R Programming

markovchain (version 0.0.8)

conditionalDistribution: conditionalDistribution of a Markov Chain

Description

It extracts the conditional distribution of the subsequent state, given current state.

Usage

conditionalDistribution(object,state)

Arguments

object
A markovchain object.
state
Subsequent state.

Value

  • A named probability vector

References

Sheldon Ross, Probability Models

See Also

markovchain

Examples

Run this code
#define a markov chain
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)
                 ))
conditionalDistribution(markovB,"b")

Run the code above in your browser using DataLab