public class SimpleMC extends java.lang.Object implements RandomNumberGenerator
| Constructor and Description |
|---|
SimpleMC(Matrix A)
Construct a time-homogeneous Markov chain with a finite state space using stationary state probabilities.
|
SimpleMC(Vector PI,
Matrix A)
Construct a time-homogeneous Markov chain with a finite state space.
|
| Modifier and Type | Method and Description |
|---|---|
ImmutableMatrix |
A()
Get the state transition probabilities.
|
static int |
bin(MultinomialRvg rvg)
Pick the first non-empty bin.
|
static Vector |
getStationaryProbabilities(Matrix A)
Get the stationary state probabilities of a Markov chain
that is irreducible, aperiodic and strongly connected (positive recurrent).
|
double |
nextDouble()
Get the next simulated state.
|
int |
nextState()
Get the next simulated state.
|
int |
nStates()
Get the number of states.
|
ImmutableVector |
PI()
Get the initial state probabilities.
|
void |
seed(long... seeds)
Seed the random number generator to produce repeatable sequences.
|
public SimpleMC(Vector PI, Matrix A)
PI - the initial state probabilitiesA - the state transition probabilitiespublic SimpleMC(Matrix A)
A - the state transition probabilitiespublic void seed(long... seeds)
RandomNumberGeneratorseed in interface RandomNumberGeneratorseeds - the seedspublic double nextDouble()
nextDouble in interface RandomNumberGeneratorpublic int nextState()
public ImmutableVector PI()
public ImmutableMatrix A()
public int nStates()
public static Vector getStationaryProbabilities(Matrix A)
A - the transition matrixpublic static int bin(MultinomialRvg rvg)
rvg - a MultinomialRvg