1. Home
2. MC1PSTATIONARY procedure

# MC1PSTATIONARY procedure

Gives the stationary probabilities for a 1st-order Markov chain (R.P. Littlejohn).

### Option

`PRINT` = string token What to print (`transitions`, `pstationary`); default `psta`

### Parameters

DATA = matrices or factors Specifies the Markov chain as a factor, or matrix of transitions Labels for the states Saves the stationary probabilities Saves the transition matrices

### Description

`MC1PSTATIONARY` prints and/or saves the stationary probabilities for a first-order Markov chain. The data are input using the `DATA` parameter, as either a matrix of transition counts or a factor of states from which the transition matrix is calculated. The probabilities and transition matrix can be saved using the `TRANSITIONS` and `PSTATIONARY` parameters, respectively.

Option: `PRINT`.

Parameters: `DATA`, `STATES`, `PSTATIONARY`, `TRANSITIONS`.

### Method

The procedure uses `LSVECTORS` to obtain the required eigenvector.

### Action with `RESTRICT`

If the `DATA` parameter is set to a list of factors, these must not be restricted.

Commands for: Time series.

### Example

```CAPTION        'MC1PSTATIONARY examples'; STYLE=meta
"Input as transition probability matrix"
MATRIX         [ROWS=2; COLUMNS=2; VALUES=.95,.05,.10,.90] m
MC1PSTATIONARY m
"Input as factor of states"
CALCULATE      u=1+INT(5*URAND(855438; 1000))
GROUP          u; FACTOR=fu
MC1PSTATIONARY [PRINT=transitions,pstationary] fu
"Input as transition count matrix"
VARIATE        [VALUES=(1...5)] vmact; DECIMALS=0
MATRIX         [ROWS=vmact; COLUMNS=vmact] mact[1,2]
1362   26    2   62    1
33   31    9   64    7
7   13    7   35    4
31   74   49  355   16
0   11    3   12    6  :