page_title: Stochastic matrix
section_title: Phase-type representation
hierarchical_section_title: Stochastic matrix / Example: the cat and mouse / Phase-type representation
context_page_description: In mathematics, a stochastic 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 is also called a probability matrix, transition matrix, substitution matrix, or Markov matrix.
  The stochastic matrix was first developed by Andrey Markov at the beginning of the 20th century, and 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.
  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 as a vector whose elements are nonnegative real numbers which sum to 1. Thus, each row of a right stochastic matrix is a stochastic vector.
context_section_description: 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 . 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,
  and 
  where  is the identity matrix, and  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,
  Higher order moments are given by
caption: The survival function of the mouse. The mouse will survive at least the first time step.
exif: {}