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.
Generates numTransitions transitions and returns the states visited, in order. The chain is left in the last state generated.
Draws a state from distribution using this chain's stream and makes it the current state, so that a path can begin from an initial distribution rather than from a fixed state. The property initialState is not changed, so a later call to reset still returns where it always did.
Generates numTransitions transitions and tabulates the states visited. The returned frequency also holds the observed transition counts, so its transitionProportions estimates this chain's transition matrix from the path just simulated.