DMarkov Chain
Randomly generates the states of a discrete Markov Chain. Assumes that the states are labeled 1, 2, 3, etc. The transition probabilities are supplied as an array of arrays. transMatrix0 holds the array of transition probabilities for transition to each state {p11, p12, p13, .., p1n} for state 1 transMatrix1 holds the array of transition probabilities for transition to each state {p21, p22, p23, .., p2n} for state 2 etc.
Author
rossetti
Parameters
the initial state
the single step transition matrix
the random number stream number, defaults to 0, which means the next stream
the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider
an optional name
Inheritors
Constructors
Properties
Functions
Simulates the chain forward starting from the startState until the desired state desiredState is reached for the first time and returns the number of transitions required to reach the desired state for the first time.
Estimates the first passage time distribution from the starting state to the desired state as an IntegerFrequency based on the provided sample size sampleSize.