page_title: Examples of Markov chains
section_title: Stock market
hierarchical_section_title: Examples of Markov chains / Discrete-time / Stock market
context_page_description: This page contains examples of Markov chains and Markov processes in action.
  All examples are in the countable state space.
context_section_description: A state diagram for a simple example is shown in the figure on the right, using a directed graph to picture the state transitions. The states represent whether a hypothetical stock market is exhibiting a bull market, bear market, or stagnant market trend during a given week. According to the figure, a bull week is followed by another bull week 90% of the time, a bear week 7.5% of the time, and a stagnant week the other 2.5% of the time. Labeling the state space {1 = bull, 2 = bear, 3 = stagnant} the transition matrix for this example is
  The distribution over states can be written as a stochastic row vector x with the relation x = xP. So if at time n the system is in state x, then three time periods later, at time n + 3 the distribution is
  In particular, if at time n the system is in state 2 (bear), then at time n + 3 the distribution is
  Using the transition matrix it is possible to calculate, for example, the long-term fraction of weeks during which the market is stagnant, or the average number of weeks it will take to go from a stagnant to a bull market. Using the transition probabilities, the steady-state probabilities indicate that 62.5% of weeks will be in a bull market, 31.25% of weeks will be in a bear market and 6.25% of weeks will be stagnant, since:
  A thorough development and many examples can be found in the on-line monograph Meyn & Tweedie 2005.
  A finite-state machine can be used as a representation of a Markov chain. Assuming a sequence of independent and identically distributed input signals (for example, symbols from a binary alphabet chosen by coin tosses), if the machine is in state y at time n, then the probability that it moves to state x at time n + 1 depends only on the current state.
caption: Using a directed graph, the probabilities of the possible states a hypothetical stock market can exhibit is represented. The matrix on the left shows how probabilities corresponding to different states can be arranged in matrix form.