Discrete Markov Chain. Theory and use

Similar documents
Probability, Random Processes and Inference

18.440: Lecture 33 Markov Chains

STOCHASTIC PROCESSES Basic notions

Outlines. Discrete Time Markov Chain (DTMC) Continuous Time Markov Chain (CTMC)

18.600: Lecture 32 Markov Chains

MATH 56A: STOCHASTIC PROCESSES CHAPTER 1

Markov Chains (Part 3)

Lesson Plan. AM 121: Introduction to Optimization Models and Methods. Lecture 17: Markov Chains. Yiling Chen SEAS. Stochastic process Markov Chains

ISM206 Lecture, May 12, 2005 Markov Chain

Markov Processes Hamid R. Rabiee

Lecture 11: Introduction to Markov Chains. Copyright G. Caire (Sample Lectures) 321

Reinforcement Learning

8. Statistical Equilibrium and Classification of States: Discrete Time Markov Chains

MARKOV PROCESSES. Valerio Di Valerio

ISE/OR 760 Applied Stochastic Modeling

18.175: Lecture 30 Markov chains

Recap. Probability, stochastic processes, Markov chains. ELEC-C7210 Modeling and analysis of communication networks

Discrete time Markov chains. Discrete Time Markov Chains, Limiting. Limiting Distribution and Classification. Regular Transition Probability Matrices

Markov Chains, Stochastic Processes, and Matrix Decompositions

The Theory behind PageRank

2 DISCRETE-TIME MARKOV CHAINS

= P{X 0. = i} (1) If the MC has stationary transition probabilities then, = i} = P{X n+1

Chapter 16 focused on decision making in the face of uncertainty about one future

Let (Ω, F) be a measureable space. A filtration in discrete time is a sequence of. F s F t

Markov Chains and Stochastic Sampling

Markov Chains CK eqns Classes Hitting times Rec./trans. Strong Markov Stat. distr. Reversibility * Markov Chains

Markov Chains. Chapter 16. Markov Chains - 1

Markov Chains (Part 4)

Summary of Results on Markov Chains. Abstract

Lecture 9 Classification of States

Math Camp Notes: Linear Algebra II

INTRODUCTION TO MARKOV CHAINS AND MARKOV CHAIN MIXING

Markov Chains. X(t) is a Markov Process if, for arbitrary times t 1 < t 2 <... < t k < t k+1. If X(t) is discrete-valued. If X(t) is continuous-valued

Lecture Notes: Markov chains Tuesday, September 16 Dannie Durand

Using Markov Chains To Model Human Migration in a Network Equilibrium Framework

MAA704, Perron-Frobenius theory and Markov chains.

SMSTC (2007/08) Probability.

On asymptotic behavior of a finite Markov chain

Lecture 20 : Markov Chains

Statistical Problem. . We may have an underlying evolving system. (new state) = f(old state, noise) Input data: series of observations X 1, X 2 X t

Stochastic Models: Markov Chains and their Generalizations

CDA6530: Performance Models of Computers and Networks. Chapter 3: Review of Practical Stochastic Processes

Markov Model. Model representing the different resident states of a system, and the transitions between the different states

Stochastic Modelling Unit 1: Markov chain models

Definition A finite Markov chain is a memoryless homogeneous discrete stochastic process with a finite number of states.

Treball final de grau GRAU DE MATEMÀTIQUES Facultat de Matemàtiques Universitat de Barcelona MARKOV CHAINS

CS145: Probability & Computing Lecture 18: Discrete Markov Chains, Equilibrium Distributions

Special Mathematics. Tutorial 13. Markov chains

Markov chains. Randomness and Computation. Markov chains. Markov processes

Chapter 2: Markov Chains and Queues in Discrete Time

APPM 4/5560 Markov Processes Fall 2019, Some Review Problems for Exam One

Discrete Time Markov Chain (DTMC)

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes

Markov Chains Introduction

Application of Finite Markov Chain to a Model of Schooling

MATH3200, Lecture 31: Applications of Eigenvectors. Markov Chains and Chemical Reaction Systems

Powerful tool for sampling from complicated distributions. Many use Markov chains to model events that arise in nature.

Irreducibility. Irreducible. every state can be reached from every other state For any i,j, exist an m 0, such that. Absorbing state: p jj =1

CDA5530: Performance Models of Computers and Networks. Chapter 3: Review of Practical

Markov Chains. Sarah Filippi Department of Statistics TA: Luke Kelly

Example: physical systems. If the state space. Example: speech recognition. Context can be. Example: epidemics. Suppose each infected

ISyE 6650 Probabilistic Models Fall 2007

Matrices: 2.1 Operations with Matrices

Convex Optimization CMU-10725

n α 1 α 2... α m 1 α m σ , A =

Lecture 7: Stochastic Dynamic Programing and Markov Processes

Understanding MCMC. Marcel Lüthi, University of Basel. Slides based on presentation by Sandro Schönborn

Monopoly An Analysis using Markov Chains. Benjamin Bernard

Today. Next lecture. (Ch 14) Markov chains and hidden Markov models

Markov Chains Handout for Stat 110

TMA 4265 Stochastic Processes Semester project, fall 2014 Student number and

Quantitative Evaluation of Emedded Systems Solution 2: Discrete Time Markov Chains (DTMC)

Stochastic Problems. 1 Examples. 1.1 Neoclassical Growth Model with Stochastic Technology. 1.2 A Model of Job Search

Lecture 3: Markov chains.

Markov Chain Monte Carlo

Note that in the example in Lecture 1, the state Home is recurrent (and even absorbing), but all other states are transient. f ii (n) f ii = n=1 < +

Markov chain Monte Carlo

Markov Chains. Arnoldo Frigessi Bernd Heidergott November 4, 2015

Markov Chains. Chapter Introduction. 1. w(1) = (.5,.25,.25) w(2) = (.4375,.1875,.375) w(3) = (.40625, , ) 1 0.

Chapter 7. Markov chain background. 7.1 Finite state space

2 Discrete-Time Markov Chains

Stochastic process. X, a series of random variables indexed by t

Data analysis and stochastic modeling

Markov Chains. Chapter Introduction. Specifying a Markov Chain

Markov chains. 1 Discrete time Markov chains. c A. J. Ganesh, University of Bristol, 2015

LIMITING PROBABILITY TRANSITION MATRIX OF A CONDENSED FIBONACCI TREE

Markov Chains. INDER K. RANA Department of Mathematics Indian Institute of Technology Bombay Powai, Mumbai , India

Math 1553, Introduction to Linear Algebra

Statistics 150: Spring 2007

Stochastic Simulation

An Application of Graph Theory in Markov Chains Reliability Analysis

Markov Processes Cont d. Kolmogorov Differential Equations

4.7.1 Computing a stationary distribution

Doing Physics with Random Numbers

Markov chains (week 6) Solutions

Social network analysis: social learning

Lecture 5: Random Walks and Markov Chain

CPSC 540: Machine Learning

The Leslie Matrix. The Leslie Matrix (/2)

Stochastic processes. MAS275 Probability Modelling. Introduction and Markov chains. Continuous time. Markov property

Transcription:

Discrete Markov Chain. Theory and use Andres Vallone PhD Student andres.vallone@predoc.uam.es 2016

Contents 1 Introduction 2 Concept and definition Examples Transitions Matrix Chains Classification 3 Empirical Uses Introduction Test the Markov Property Estimating the Transition Matrix Example

Introduction

Introduction Introduction What is the probability of have a nice day tomorrow if today is raining? What is the probability of buy a Coke when you first buy a Pepsi? What is the probability of a state move out of poverty? How was the evolution of the income distribution in a country?

Introduction Introduction What is the probability of have a nice day tomorrow if today is raining? What is the probability of buy a Coke when you first buy a Pepsi? What is the probability of a state move out of poverty? How was the evolution of the income distribution in a country? Al of this questions can be answering by the use of a Discrete Markov Chain.

What is a DMC? Concept and definition The Markov Chain is a discrete-time stochastic process Describes a system whose states change over time Changes are governed by a probability distribution Is a memorylessness process: the next state only depends upon the current system state,the path to the present state is not relevant In order to make a formal definition suppose that exists: Set of independent state S = {s 1,..., s k } A sequence of random variables X 0, X 1, X 2,... with values in S that describes the state of the system in time t A set of transition rules specifying the probability of move from the state i in time t to the state j in time t + 1 If the rules are independent of time, the DMC is homogeneous.

Discrete Markov Chain Concept and definition Definition A random process X 0, X 1, X 2,... with finite state space S = {s 1,..., s k } is said to be a Markov homogeneous chain if i, j {i,..., k} and i 0,..., i n 1 {1,..., k} P [ X t+1 = j X 0 = i 0, X 1 = i 1,..., X t 1 = in 1, X t = i ] = = P [ X t+1 = j X t = i ] = p i,j p i,j is a conditional probability: defines the probability that the chain jumps to state j, at time t + 1, given that it is in state i at time t, p i,j is a rule of movement, since S has size k, exist k k rules of movement. The set of rules specify the transition matrix.

The Transition Matrix Concept and definition p 11 p 12... p 1k p 21 p 22... p 2k P =...... p k1 p k2... p kk Each p ij denote the probability of one step in time Are probabilities p i,j 0 All state are exclusive k p ij = 1 i=1 In case of an homogeneous DMC p ij = p i,j t Homogeneity implies that every time the chain is in state s, the probability of jumping to another state is the same.

Example 1 Examples According to Kemeny, Snell, and Thompson 1, Land of Oz is blessed by many things, but not by good weather. They never have two nice days in a row. If they have a nice day, they are just as likely to have snow as rain the next day. If they have snow or rain, they have an even chance of having the same the next day. If there is change from snow or rain, only half of the time is this a change to a nice day What are the transition matrix in this case? 1 J. G. Kemeny, J. L. Snell, G. L. Thompson, Introduction to Finite Mathematics, 3rd ed. (Englewood Cliffs, NJ: Prentice-Hall, 1974)

Example 1 Examples Rain 0.25 0.25 0.25 Transition Matrix 1/2 1/4 1/4 P = 1/2 0 1/2 1/4 1/4 1/2 Nice Snow 0.25

Example 2 Examples Coke or Pepsi? Given that a person s last cola purchase was Coke, there is a 90% chance that his next cola purchase will also be Coke. If a person s last cola purchase was Pepsi, there is an 80% chance that his next cola purchase will also be Pepsi. What are the transition matrix in this case?

Example 2 Examples Pepsi 0.8 0.2 0.1 Transition Matrix [ ] 0.9 0.1 P = 0.2 0.8 Coke 0.9

The Transition Matrix Transitions Matrix Consider the example 1, what is the probability of have an snowy day in two days, if today is raining? Have a snowy day in two days denote as p (2) 13 is the disjoint union of: (a) it is rainy tomorrow and snowy two days from now (b) it is nice tomorrow and snowy two days from now (c) it is snowy tomorrow and snowy two days from now p (2) 13 = p 11p 13 + p 12 p 21 + p 13 p 33 This is just what is done in obtaining the 1,3-entry of the product of P with itself. Day 1 1/2 1/4 1/4 P = 1/2 0 1/2 1/4 1/4 1/2 Day 2 1/2 1/4 1/4 P = 1/2 0 1/2 1/4 1/4 1/2

The Transition Matrix Transitions Matrix Proposition (Chapman-Kolgomorov equation) For any n > 0,m > 0, i S, j S p m+n ij = k S p n i,kp m jk

The Transition Matrix Transitions Matrix Proposition (Chapman-Kolgomorov equation) For any n > 0,m > 0, i S, j S p m+n ij = k S p n i,kp m jk Theorem Let P be the transition matrix of a Markov chain. The ij-th entry of the matrix P n gives the probability that the Markov chain, starting in state s i, will be in state s j after n steps.

Long therm behaviour Transitions Matrix Let π 0 a vector k 1 defining for all state i the probability that the Markov chain is initially at i π 0 (i) = P [X 0 = i] : i = 1,..., k Consider a vector π n (j) k 1 that defines the probabilities that the Markov chain is at state j after n step π n (j) = { π n (1),..., π n (k) } Theorem Let P be the transition matrix of a Markov chain, and let π 0 be the probability vector which represents the starting distribution. Then the probability that the chain is in state s i after n steps is the ith entry of π n = P n π 0

Chains Classification Periodic State Chains Classification 1 1 2 3 4 5 1 0 1 0 0 0 0.25 0 0 0.25 0 0 0 P = 0 0 0 P 2n 0 0 0 0 = 0.25 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0.25 0 0 0.25 0 0 0 P 2n+1 0.25 0 0 0.25 This means at every = 0 0 0 state i, if n is an even 0.25 0 0 0.25 number P n (i, i) > 0 0 0 0

Chains Classification Absorbing State Chains Classification 1 2 3 4 5 1 1 1 0 0 0 0 0 0 0 P = 0 0 0 0 0 0 0 0 0 0 1 rows are not identical, i.e, the chain does not forget the initial state

Chains Classification Absorbing State Chains Classification 1 2 3 4 5 1 1 1 0 0 0 0 P n 0.75 0 0 0 0.25 = 0 0 0 0.25 0 0 0 0.75 0 0 0 0 1 states 2, 3, 4 are transient: p n i2 = p n i3 = pn i4 = 0 i.e. after passing a large amount of time the chain will stop visiting this states.

Chains Classification Reducible Chains Chains Classification 0.1 0.2 0.7 1 2 3 4 5 0.2 0.8 0.9 0.3 0.7 0.6 0.2 0.3 0.2 0.8 0 0. 0 0.1 0.9 0 0 0 P = 0 0 0.3 0.7 0 0 0 0.2 0.6 0.2 0 0 0 0.7 0.3 0.1 0.9 0 0 0 P n 0.1 0.9 0 0 0 = 0 0 0.2 0.6 0 0 0.2 0.6 0.2 0 0 0.2 0.6 0.2

Chains Classification Ergodic Chains Chains Classification State j is reachable from state i if probability to go from i to j in n 0 steps is greater then 0 A subset X of the state space S is closed if p ij = 0, i S and j S A closed set of states is irreducible if any state j S is reachable from any state i S A Markov Chain is irreducible if the state space S is irreducible

Chains Classification Irreducible Chains Chains Classification Ergodic p 21 p 32 1 2 3 p 11 p 12 p 23 p 33 Reducible p 21 p 43 1 2 3 4 p 11 p12 p 23 p 33 p34 p 44 p 25 5

Steady State chain Chains Classification Theorem (Basic Limit Theorem) Any ergodic, aperiodic, Markov chain defined on a set of state S and with a stochastic transition matrix P has a unique stationary distribution π with all its component positive. Furthermore, let P n be the n-th power of P, then lim π (j) P n = π n

Empirical Uses

Introduction Empirical Uses Introduction In social science is not common work with discrete state variables. Wrong discretizaton produce wrong result by (cite) In necessary test if the random variables follow a Markov process Is necessary find the Transition matrix

Empirical Uses Test the Markov Property Bickenbach, F., & Bode, E. (2003). Test the Markov Property First, homogeneity over time (time-stationarity) can be checked by dividing the entire sample into T periods, and testing whether or not the transition matrices estimated from each of the T subsamples differ significantly from the matrix estimated from the entire sample. H 0 : t p ij (t) = p ij t = 1,..., T H 1 : t p ij (t) ij ) Q (T ) = T 2 ( ) N (ˆpij (t) ˆp ij N n i (t) asy χ 2 (a i 1) (b 1 1) t=1 i=1 j B i ˆp ij i=1

Empirical Uses Test the Markov Property Bickenbach, F., & Bode, E. (2003). Test the Markov Property ) Q (T ) = T 2 ( ) N (ˆpij (t) ˆp ij N n i (t) asy χ 2 (a i 1) (b 1 1) t=1 i=1 j B i ˆp ij i=1 ˆp ij denotes the probability of transition from the i-th to the j-th class estimated from the entire sample ˆp ij (t) the corresponding transition probability estimated from the t-th sub-sample ˆp ij (t) = n ij (t) /n ij n i (t) denotes the absolute number of observations initially falling into the i-th class within the t-th sub-sample. b i = B i is the number of positive entries in the i-th row of the matrix for the entire sample B i = { j : ˆp ij } a 1 = A i is the number of sub-samples (t) in which observations for the i-th row are available A i = { t : n (t) > 0 }

Empirical Uses Estimating the Transition Matrix Estimating the Transition Matrix We need to estimate all the p ij parameters of the matrix k k of probabilities. p ij = P [ X t+1 = j X t = i ] We have a sample from the chain x n x 1,..., x n that is a realization of the Markov chain X1 n n P [X1 n = x n 1 ] = P [ ] X t = x t X t 1 = x t 1 t=1 Re-written in term of transitions probability p ij n L (p) = p xt 1,x t t=2 Defining n ij as the number of times i is followed by j in X1 n k k L (p) = i=1 j=1 p n ij ij

Empirical Uses Estimating the Transition Matrix Estimating the Transition Matrix L (p) = k k p n ij ij i=1 j=1 Taking log and remembering that j p ij = 1 to find p ij is necessary solve: Max p ij l (p) = i,j j n ij log p ij λ i i=1 j The first order conditions of this problem are: p ij 1 l p ij = n ij p ij λ i 0 (1) l λ i = j p ij 1 0 (2)

Empirical Uses Estimating the Transition Matrix From (1) Estimating the Transition Matrix p ij = n ij λ i (3) knowing that we have k lagrange multipliers and using (2) and (3) k j=1 k j=1 n ij λ i 1 n ij = λ i (4) With (3) and (4) ˆp ij = n ij k n ij j=1

Example Empirical Uses Example EN proceso...