TheInfoList

In mathematics, a stochastic matrix (also termed probability matrix, transition matrix, substitution matrix, or Markov matrix) is a square matrix used to describe the transitions of a Markov chain. Each of its entries is a nonnegative real number representing a probability. It has found use throughout a wide variety of scientific fields, including probability theory, statistics, mathematical finance and linear algebra, as well as computer science and population genetics. The stochastic matrix was first developed by Andrey Markov at the beginning of the 20th century. There are several different definitions and types of stochastic matrices:

A right stochastic matrix is a real square matrix, with each row summing to 1.
A left stochastic matrix is a real square matrix, with each column summing to 1.
A doubly stochastic matrix is a square matrix of nonnegative real numbers with each row and column summing to 1.

In the same vein, one may define a stochastic vector (also called probability vector) as a vector whose elements are nonnegative real numbers which sum to 1. Thus, each row of a right stochastic matrix (or column of a left stochastic matrix) is a stochastic vector.

A common convention in English language mathematics literature is to use row vectors of probabilities and right stochastic matrices rather than column vectors of probabilities and left stochastic matrices; this article follows that convention.

## History

The stochastic matrix was developed alongside the Markov chain by Andrey Markov, a Russian mathematician and professor at St. Petersburg University who first published on the topic in 1906. His initial intended uses were for linguistic analysis and other mathematical subjects like card shuffling, but both Markov chains and matrices rapidly found use in other fields. Markov was persecuted by the Soviet Union and escaped political punishment at his death in 1922.[dubious ][not in citation given]

Stochastic matrices were further developed by scholars like Andrey Kolmogorov, who expanded their possibilities by allowing for continuous-time Markov processes. By the 1950s, stochastic matrices had begun to be used outside of their original mathematical fields, and articles appeared in the fields of econometrics, and circuit theory. In the 1960s, stochastic matrices appeared in an even wider variety of scientific works, from behavioral science to geology to residential planning. In addition, much mathematical work was also done through these decades to improve the range of uses and functionality of the stochastic matrix and Markovian processes more generally.

From the 1970s to present, stochastic matrices have found use in almost every field that requires formal analysis, from structural science to medical diagnosis to personnel management. In addition, stochastic matrices have found wide use in land change modeling, usually under the term Markov matrix.

## Definition and properties

A stochastic matrix describes a Markov chain ${\boldsymbol {X}}_{t}$ over a finite state space S with cardinality $S$ .

If the probability of moving from $i$ to $j$ in one time step is $Pr(ji)=P_{i,j}$ , the stochastic matrix $P$ is given by using $P_{i,j}$ as the $i^{th}$ row and $j^{th}$ column element, e.g.,

$P=\left({\begin{matrix}P_{1,1}&P_{1,2}&\dots &P_{1,j}&\dots &P_{1,S}\\P_{2,1}&P_{2,2}&\dots &P_{2,j}&\dots &P_{2,S}\\\vdots &\vdots &\ddots &\vdots &\ddots &\vdots \\P_{i,1}&P_{i,2}&\dots &P_{i,j}&\dots &P_{i,S}\\\vdots &\vdots &\ddots &\vdots &\ddots &\vdots \\P_{S,1}&P_{S,2}&\dots &P_{S,j}&\dots &P_{S,S}\\\end{matrix}}\right).$ Since the total of transition probability from a state $i$ to all other states must be 1, this matrix is a right stochastic matrix, so that

$\sum _{j=1}^{S}P_{i,j}=1.\,$ The above elementwise sum across each row $i$ of $P$ may be more concisely written as $P\mathbf {1} =\mathbf {1}$ , where $\mathbf {1}$ is the $S$ -dimensional vector of all ones. Using this, it can be seen that the product of two right stochastic matrices $P^{\prime }$ and $P^{\prime \prime }$ is also right stochastic: $P^{\prime }P^{\prime \prime }\mathbf {1} =P^{\prime }(P^{\prime \prime }\mathbf {1} )=P^{\prime }\mathbf {1} =\mathbf {1}$ . In general, the $k$ -th power $P^{k}$ of a right stochastic matrix $P$ is also right stochastic. The probability of transitioning from $i$ to $j$ in two steps is then given by the $(i,j)^{th}$ element of the square of $P$ :

$\left(P^{2}\right)_{i,j}.$ In general the probability transition of going from any state to another state in a finite Markov chain given by the matrix $P$ in k steps is given by $P^{k}$ .

An initial distribution is given as a row vector.

A stationary probability vector ${\boldsymbol {\pi }}$ is defined as a distribution, written as a row vector, that does not change under application of the transition matrix; that is, it is defined as a probability distribution on the set $\{1,...,n\}$ which is also a row eigenvector of the probability matrix, associated with eigenvalue 1:

${\boldsymbol {\pi }}P={\boldsymbol {\pi }}.$ The right spectral radius of every right stochastic matrix is clearly at most 1. Additionally, every right stochastic matrix has an obvious column eigenvector associated to the eigenvalue 1: The vector ${\boldsymbol {1}}$ , whose coordinates are all equal to 1. As left and right eigenvalues of a square matrix are the same, every stochastic matrix has, at least, a row eigenvector associated to the eigenvalue 1 and the largest absolute value of all its eigenvalues is also 1. Finally, the Brouwer Fixed Point Theorem (applied to the compact convex set of all probability distributions of the finite set $\{1,...,n\}$ ) implies that there is some left eigenvector which is also a stationary probability vector.

On the other hand, the Perron–Frobenius theorem also ensures that every irreducible stochastic matrix has such a stationary vector, and that the largest absolute value of an eigenvalue is always 1. However, this theorem cannot be applied directly to such matrices because they need not be irreducible.

In general, there may be several such vectors. However, for a matrix with strictly positive entries (or, more generally, for an irreducible aperiodic stochastic matrix), this vector is unique and can be computed by observing that for any $i$ we have the following limit,

$\lim _{k\rightarrow \infty }\left(P^{k}\right)_{i,j}={\boldsymbol {\pi }}_{j},$ where ${\boldsymbol {\pi }}_{j}$ is the $j^{th}$ element of the row vector ${\boldsymbol {\pi }}$ . Among other things, this says that the long-term probability of being in a state $j$ is independent of the initial state $i$ . That both of these computations give the same stationary vector is a form of an ergodic theorem, which is generally true in a wide variety of dissipative dynamical systems: the system evolves, over time, to a stationary state.

Intuitively, a stochastic matrix represents a Markov chain; the application of the stochastic matrix to a probability distribution redistributes the probability mass of the original distribution while preserving its total mass. If this process is applied repeatedly, the distribution converges to a stationary distribution for the Markov chain.

## Example: the cat and mouse

Suppose you have a timer and a row of five adjacent boxes, with a cat in the first box and a mouse in the fifth box at time zero. The cat and the mouse both jump to a random adjacent box when the timer advances. E.g. if the cat is in the second box and the mouse in the fourth one, the probability is one fourth that the cat will be in the first box and the mouse in the fifth after the timer advances. If the cat is in the first box and the mouse in the fifth one, the probability is one that the cat will be in box two and the mouse will be in box four after the timer advances. The cat eats the mouse if both end up in the same box, at which time the game ends. The random variable K gives the number of time steps the mouse stays in the game.

The Markov chain that represents this game contains the following five states specified by the combination of positions (cat,mouse). Note that while a naive enumeration of states would list 25 states, many are impossible either because the mouse can never have a lower index than the cat (as that would mean the mouse occupied the cat's box and survived to move past it), or because the sum of the two indices will always have even parity. In addition, the 3 possible states that lead to the mouse's death are combined into one:

• State 1: (1,3)
• State 2: (1,5)
• State 3: (2,4)
• State 4: (3,5)
• State 5: game over: (2,2), (3,3) & (4,4).

We use a stochastic matrix, $P$ (below), to represent the transition probabilities of this system (rows and columns in this matrix are indexed by the possible states listed above, with the pre-transition state as the row and post-transition state as the column). For instance, starting from state 1 - 1st row - it is impossible for the system to stay in this state, so $P_{11}=0$ ; the system also cannot transition to state 2 - because the cat would have stayed in the same box - so $P_{12}=0$ , and by a similar argument for the mouse, $P_{14}=0$ . Transitions to states 3 or 5 are allowed, and thus $P_{13},P_{15}\neq 0$ .

$P={\begin{bmatrix}0&0&1/2&0&1/2\\0&0&1&0&0\\1/4&1/4&0&1/4&1/4\\0&0&1/2&0&1/2\\0&0&0&0&1\end{bmatrix}}.$ ### Long-term averages

No matter what the initial state, the cat will eventually catch the mouse (with probability 1) and a stationary state π = (0,0,0,0,1) is approached as a limit. To compute the long-term average or expected value of a stochastic variable Y, for each state Sj and time tk there is a contribution of Yj,k·P(S=Sj,t=tk). Survival can be treated as a binary variable with Y=1 for a surviving state and Y=0 for the terminated state. The states with Y=0 do not contribute to the long-term average.

### Phase-type representation The survival function of the mouse. The mouse will survive at least the first time step.

As State 5 is an absorbing state, the distribution of time to absorption is discrete phase-type distributed. Suppose the system starts in state 2, represented by the vector $[0,1,0,0,0]$ . The states where the mouse has perished don't contribute to the survival average so state five can be ignored. The initial state and transition matrix can be reduced to,

${\boldsymbol {\tau }}=[0,1,0,0],\qquad T={\begin{bmatrix}0&0&{\frac {1}{2}}&0\\0&0&1&0\\{\frac {1}{4}}&{\frac {1}{4}}&0&{\frac {1}{4}}\\0&0&{\frac {1}{2}}&0\end{bmatrix}},$ and

$(I-T)^{-1}{\boldsymbol {1}}={\begin{bmatrix}2.75\\4.5\\3.5\\2.75\end{bmatrix}},$ where $I$ is the identity matrix, and $\mathbf {1}$ represents a column matrix of all ones that acts as a sum over states.

Since each state is occupied for one step of time the expected time of the mouse's survival is just the sum of the probability of occupation over all surviving states and steps in time,

$E[K]={\boldsymbol {\tau }}\left(I+T+T^{2}+\cdots \right){\boldsymbol {1}}={\boldsymbol {\tau }}(I-T)^{-1}{\boldsymbol {1}}=4.5.$ Higher order moments are given by

$E[K(K-1)\dots (K-n+1)]=n!{\boldsymbol {\tau }}(I-{T})^{-n}{T}^{n-1}\mathbf {1} \,.$
{"ft_lang_label":"__label__en","ft_lang_prob":0.9438774,"math_prob":0.99789375,"size":9009,"snap":"2020-34-2020-40","text_gpt3_token_len":1883,"char_repetition_ratio":0.16935036,"word_repetition_ratio":0.019320453,"special_character_ratio":0.2080142,"punctuation_ratio":0.090694934,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99960285,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112],"im_url_duplicate_count":[null,5,null,null,null,null,null,null,null,4,null,null,null,null,null,null,null,null,null,1,null,null,null,1,null,null,null,null,null,5,null,null,null,null,null,null,null,5,null,5,null,null,null,10,null,null,null,null,null,null,null,5,null,null,null,9,null,null,null,10,null,null,null,null,null,9,null,null,null,null,null,null,null,9,null,5,null,null,null,null,null,null,null,null,null,null,null,8,null,8,null,8,null,8,null,9,null,3,null,8,null,8,null,8,null,null,null,null,null,8,null,9,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-13T19:42:46Z\",\"WARC-Record-ID\":\"<urn:uuid:196abef0-115d-4579-b5b9-ca37cfafc0b8>\",\"Content-Length\":\"130171\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:416c106f-0cc9-4569-aa57-fa8a48828cf0>\",\"WARC-Concurrent-To\":\"<urn:uuid:99ae154e-132c-4742-a9d2-0555ea425f3f>\",\"WARC-IP-Address\":\"67.249.226.212\",\"WARC-Target-URI\":\"http://www.theinfolist.com/php/SummaryGet.php?FindGo=Stochastic_matrix\",\"WARC-Payload-Digest\":\"sha1:ZMYFI3TO7PBENXLWNF57CEKYQGK4ACK2\",\"WARC-Block-Digest\":\"sha1:AFGUTMUIU5ODV2IMJU2ELCHBFPY2RD25\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439739073.12_warc_CC-MAIN-20200813191256-20200813221256-00042.warc.gz\"}"}