Category Archives: one-liner

TI Nspire shortcuts for finding Markov chain stationary distribution

In previous installment, the stationary distribution of Markov chain is determined in TI Nspire using built-in linSolve function. Apart from theĀ implementation used, there are some shortcuts in TI Nspire that will arrive the same result. The first one is kind of a one-liner that distill all steps for solving for the stationary distribution, which can easily be programmed in Nspire using TI-Basic, is exemplified below in self-explanatory notes:
markov_stationarydist_quick1

The full one-liner in TI Nspire is as below:

simult(colAugment((subMat(p,1,1,rowDim(p),rowDim(p)-1))T,augment(list>mat(seqn(1,rowDim(p)-1)),[2]))-identity(rowdim(p)),colAugment(newMat(rowDim(p)-1,1),[1]))

markov_stationarydist_quick2

The other one is based on the fact the stationary distribution converges itself after repeated multiplication. This is tedious before the advent of modern computation power, but a piece of cake today even with hand-held calculators šŸ™‚

markov_stationarydist_quick3

Advertisements