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
If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers
Tells the stream to start producing antithetic variates
The initial starting state of the chain
The last (previous) randomly generated value. This value does not change until the next randomly generated value is obtained
If true, the stream will automatically participate in having its stream reset to its start stream via stream managers
Functions
Positions the RNG at the beginning of its next substream
Creates an instance of the random variable that is independent of the underlying stream provider but has an underlying stream that is in the exact same state as the random variable's stream, except that it is set to produce antithetic pseudo-random numbers (1-u). That is, its stream is a clone and will produce the antithetic sequence of pseudo-random numbers (i.e. 1-u1, 1-u2, 1-u3,...).
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.
Creates an instance of the random variable that is independent of the underlying stream provider but has an underlying stream that is in the exact same state as the random variable's stream. That is, its stream is a clone and will produce the same sequence of pseudo-random numbers (i.e. common random numbers).
Estimates the first passage time distribution from the starting state to the desired state as an IntegerFrequency based on the provided sample size sampleSize.
An instance of the random variable with the stream provided by the same underlying stream provider
The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.
Resets the position of the RNG at the start of the current substream
Generates the number of columns nCols with each column holding a random sample of size sampleSize
Generates the number of rows nRows with each row holding a random sample of size sampleSize
Fills the supplied matrix with randomly generated values
Fills the supplied array with randomly generated values