The sequence d represents the number of states each discrete random variable can take. For example, if there are four random variables with the following state space sizes
i1 : d=(2,3,4,5)
o1 = (2, 3, 4, 5)
o1 : Sequence
|
the corresponding ring will have as variables all the possible joint probability distributions for the four variables:
i2 : R = markovRing d;
|
i3 : numgens R
o3 = 120
|
i4 : R_0, R_1, R_119 --here are some of the variables in the ring
o4 = (p , p , p )
1,1,1,1 1,1,1,2 2,3,4,5
o4 : Sequence
|
If no coefficient choice is specified, the polynomial ring is created over the rationals.
i5 : coefficientRing R
o5 = QQ
o5 : Ring
|
If we prefer to have a different base field, the following command can be used:
i6 : Rnew = markovRing (d,Coefficients=>CC);
|
i7 : coefficientRing Rnew
o7 = CC
53
o7 : ComplexField
|
We might prefer to give different names to our variables. The letter ”p” suggests a joint probability, but it might be useful to create a new ring where the variables have changed. This can easily be done with the following option:
i8 : d=(1,2);
|
i9 : markovRing (d,VariableName=>q);
|
i10 : vars oo --here is the list of variables.
o10 = | q_(1,1) q_(1,2) |
1 2
o10 : Matrix (QQ[q , q ]) <--- (QQ[q , q ])
1,1 1,2 1,1 1,2
|