LECTURE NOTES: Discrete time Markov Chains (2/24/03; SG)

Similar documents
The Wright-Fisher Model and Genetic Drift

URN MODELS: the Ewens Sampling Lemma

Inventory Model (Karlin and Taylor, Sec. 2.3)

So in terms of conditional probability densities, we have by differentiating this relationship:

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

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

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

2 Discrete-Time Markov Chains

AARMS Homework Exercises

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

Introductory seminar on mathematical population genetics

Derivation of Itô SDE and Relationship to ODE and CTMC Models

Lab 8: Measuring Graph Centrality - PageRank. Monday, November 5 CompSci 531, Fall 2018

The Λ-Fleming-Viot process and a connection with Wright-Fisher diffusion. Bob Griffiths University of Oxford

Lectures on Probability and Statistical Models

SARAH P. OTTO and TROY DAY

Elementary Applications of Probability Theory

Online Social Networks and Media. Link Analysis and Web Search

spring, math 204 (mitchell) list of theorems 1 Linear Systems Linear Transformations Matrix Algebra

Math 105 Exit Exam Review

Linear Systems of ODE: Nullclines, Eigenvector lines and trajectories

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Linear Systems of ODE: Nullclines, Eigenvector lines and trajectories

Markov Chains, Stochastic Processes, and Matrix Decompositions

Online Social Networks and Media. Link Analysis and Web Search

The Singular Value Decomposition

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

A Note on Google s PageRank

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

Lecture 10: Powers of Matrices, Difference Equations

6.842 Randomness and Computation March 3, Lecture 8

(b) What is the variance of the time until the second customer arrives, starting empty, assuming that we measure time in minutes?

Statistical population genetics

N.G.Bean, D.A.Green and P.G.Taylor. University of Adelaide. Adelaide. Abstract. process of an MMPP/M/1 queue is not a MAP unless the queue is a

0.1 Naive formulation of PageRank

Numerical Methods - Numerical Linear Algebra

Discrete time Markov chains. Discrete Time Markov Chains, Definition and classification. Probability axioms and first results

Mathematical Population Genetics. Introduction to the Stochastic Theory. Lecture Notes. Guanajuato, March Warren J Ewens

DATA MINING LECTURE 13. Link Analysis Ranking PageRank -- Random walks HITS

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

TMA Calculus 3. Lecture 21, April 3. Toke Meier Carlsen Norwegian University of Science and Technology Spring 2013

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

Markov Chains, Random Walks on Graphs, and the Laplacian

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 Chains Handout for Stat 110

3 Differential Reproduction

Part IA Probability. Definitions. Based on lectures by R. Weber Notes taken by Dexter Chua. Lent 2015

AA 242B / ME 242B: Mechanical Vibrations (Spring 2016)

Lecture 5: Random Walks and Markov Chain

Problems on Evolutionary dynamics

Lecture 1: Review on Probability and Statistics

Lecture 20 : Markov Chains

MAA704, Perron-Frobenius theory and Markov chains.

Notes for Math 450 Stochastic Petri nets and reactions

Probability Distributions

PageRank: The Math-y Version (Or, What To Do When You Can t Tear Up Little Pieces of Paper)

Stochastic processes and

Markov Chains and Stochastic Sampling

MATH 446/546 Test 2 Fall 2014

Algebraic Representation of Networks

Linear Algebra Solutions 1

Math 1553, Introduction to Linear Algebra

EK102 Linear Algebra PRACTICE PROBLEMS for Final Exam Spring 2016

A Probability Primer. A random walk down a probabilistic path leading to some stochastic thoughts on chance events and uncertain outcomes.

Metapopulations with infinitely many patches

Markov Chains. Chapter 16. Markov Chains - 1

Statistical Inference

6 Continuous-Time Birth and Death Chains

Stochastic Processes

STAT 536: Migration. Karin S. Dorman. October 3, Department of Statistics Iowa State University

Lecture 12: Link Analysis for Web Retrieval

LECTURE 3. Last time:

Math 304 Handout: Linear algebra, graphs, and networks.

MAT SYS 5120 (Winter 2012) Assignment 5 (not to be submitted) There are 4 questions.

18.600: Lecture 32 Markov Chains

Stochastic process for macro

Introduction to population genetics & evolution

Lecture 14 Chapter 11 Biology 5865 Conservation Biology. Problems of Small Populations Population Viability Analysis

1 Stat 605. Homework I. Due Feb. 1, 2011

Evolutionary Theory. Sinauer Associates, Inc. Publishers Sunderland, Massachusetts U.S.A.

Markov Chains and MCMC

Random Times and Their Properties

Chapter 2. Some basic tools. 2.1 Time series: Theory Stochastic processes

Lecture 2: September 8

EECS 495: Randomized Algorithms Lecture 14 Random Walks. j p ij = 1. Pr[X t+1 = j X 0 = i 0,..., X t 1 = i t 1, X t = i] = Pr[X t+

19. Genetic Drift. The biological context. There are four basic consequences of genetic drift:

Probability Distributions

CINQA Workshop Probability Math 105 Silvia Heubach Department of Mathematics, CSULA Thursday, September 6, 2012

Solution of Matrix Eigenvalue Problem


Birth-death chain models (countable state)

THE QUEEN S UNIVERSITY OF BELFAST

Example Linear Algebra Competency Test

Notes on Measure Theory and Markov Processes

Stochastic2010 Page 1

Heterozygosity is variance. How Drift Affects Heterozygosity. Decay of heterozygosity in Buri s two experiments

COPYRIGHTED MATERIAL CONTENTS. Preface Preface to the First Edition

4.1 Markov Processes and Markov Chains

Demography April 10, 2015

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

Transcription:

LECTURE NOTES: Discrete time Markov Chains (2/24/03; SG) A discrete time Markov Chains is a stochastic dynamical system in which the probability of arriving in a particular state at a particular time moment depends only on the state at the previous moment. That is, states are discrete: i = 0, 1, 2,... time is discrete: t = 1, 2,... probabilities p ij of transition from state i to state j in one time step are constant, i.e., they do not depend on time and do not depend on how the system got in state i ( Markov property ). Island example Consider an island that may be repeatedly colonized by a certain species which also may go extinct. State variable: X(t) = { 0 if island is empty at time t, 1 if island is occupied at time t. Dynamic rule: { X(t + 1) = 0 with prob. 0.2, If X(t) = 0, then X(t + 1) = 1 with prob. 0.8. { X(t + 1) = 0 with prob. 0.1, If X(t) = 1, then X(t + 1) = 1 with prob. 0.9 That is, the probability of colonization is p col = 0.2 and the probability of extinction is p ext = 0.1. QUESTION: what is the long-term behavior of the system? Matlab code set parameters: number of generations T, p col and p ext set initial conditions: X(1) = 0 (island is empty) 1

set update rule set graphics: plot(x) print frequency of being occupied: X mean = mean(x) play with the model and look for patterns QUESTIONS: can we predict X(t)? What can be predicted? Analytical theory Define the probabilities x 0 (t) = P r(x(t) = 0), x 1 (t) = P r(x(t) = 1). Recall the Law of Total Probability: Let B i be a set of mutually exclusive (no pair intersect) and collectively exhaustive (the union is the full set) events. Then P r(a) = i P r(a B i )P r(b i ) where P r(b i ) is the probability of B i and P r(a B i ) is the probability of A conditioned on B i. Using the Law of Total Probability P r(x(t + 1) = 0) =P r(x(t + 1) = 0 X(t) = 0) P r(x(t) = 0)+ P r(x(t + 1) = 0 X(t) = 1) P r(x(t) = 1), P r(x(t + 1) = 1) = P r(x(t + 1) = 1 X(t) = 0) P r(x(t) = 0)+ P r(x(t + 1) = 1 X(t) = 1) P r(x(t) = 1), which can be rewritten as x 0 (t + 1) = p 00 x 0 (t) + p 01 x 1 (t), x 1 (t + 1) = p 10 x 0 (t) + p 11 x 1 (t), 2

which, in turn, can be rewritten in matrix notation as Finally, let the distribution vector be and the transition matrix be Then the dynamics of x(t) are described by Note that Thus (x 0 (t + 1), x 1 (t + 1)) = (x 0 (t), x 1 (t)) x(t) = (x 0 (t), x 1 (t)) P = ( ) p00 p 10. p 01 p 11 x(t + 1) = x(t)p. x(1) = x(0)p, x(2) = x(1)p = x(0)p 2, x(3) = x(2)p = x(0)p 3,... x(t) = x(0)p t, ( ) p00 p 10 p 01 p 11 where vector x(t) characterizes the initial probabilities. For example, if the island is initially empty, then x(0) = (1, 0). Matlab code set parameters: number of generations T, probabilities p col, p ext and the transition matrix P set initial distribution: x = [1 0] (island is empty) set update rule: x(t, :) = x(1, :) P t set graphics: plot(1 : T, x(:, 1), 1 : T, x) :, 2) print asymptotic frequency of being occupied: x(t, 2) play with the model and look for patterns compare results with stochastic simulations 3

Random genetic drift Consider a randomly mating diploid population with size N. Assume there is a single locus with alleles A and a. The population state is characterized by the number of alleles A: Let X = 0, 1, 2,... 2N. x i (t) = P r(x = i) be the probability that the population has i alleles A at generation t. Can we predict the dynamics of x i (t) using a Markov chain model? Let q i = i 2N be the current frequency of a, and 1 q i be the current frequency of A. Under the Fisher-Wright binomial scheme for random genetic drift the transition probabilities are ( ) 2N P ij = q j i j (1 q i) 2N j where ( ) 2N j is the binomial coefficient. Matlab code set parameters: number of generations T, population size N, the initial frequency p0 set the transition matrix (the binomial coefficient is given by command nchoosek(2 N, j) set initial population set graphics: place inside the loop for t = 2 : T... end bar(1 : 2 B, x(t, :)) play with the model and look for patterns compare results with stochastic simulations 4

Dynamics equation Asymptotic state x(t + 1) = x(t)p has an equilibrium x that satisfies to matrix equation The latter can be rewritten as x = xp. xp = λx with λ = 1. This shows that the equilibrium distribution is given by the eigenvector of matrix P corresponding to the eigenvalue λ = 1. To find the eigenvectors and eigenvalues use command (notice the transpose sign ). Type [V, D] = eig(p ) to get help. You will need to normalize the eigenvector, say k-th eigenvector, by doing help eig V (:, k)/sum(v (:, k)) Find the stationary distributions for the Island model and for the Random Genetic Drift model. Absorption states: absorption probabilities State i is an absorption state if p ii = 1 (can t leave it once you get there). In the Random Genetic Drift model there are two absorption states: i = 0 and i = 2 N. Assume there are two absorption states: O and Ω. Let π i be the probability of absorption at state Ω rather than at state 0 if starting at state i. Then p i can be found from a system of linear algebraic equations π 0 = 0, π Ω = 1, π i = j P ij π j Using matrix notation, let π = (π 1, π 2,..., π Ω 1 ), Let P be a truncated matrix P (with rows and columns corresponding to the absorption states removed). 5

Let p Ω be the column of P corresponding to Ω with the element corresponding to state 0 removed. Then π = ( I P ) 1 pω, where I is the identity matrix. Absorption states: average absorption times Let T i be the average time to reach an absorption state if starting at state i. Then T i can be found from a system of linear algebraic equations T 0 = 0, T Ω = 0, T i = 1 + j P ij T j Using matrix notation, let Then T = (T 1, T 2,..., T Ω 1 ), T = ( I P ) 1 J, where J = (1, 1,..., 1 is a vector of 1 s. Use Matlab code fixation.m to study fixation probabilities and fixation times in the Random Genetic Drift model. Assignment Assume there are S sites arranged along a line. Assume that an individual starts at site i and makes a step right or left with equal probability m(< 1/2). Study this random walk using stochastic simulations and a Markov chain model. How long does it take to reach absorbing states 1 and S. Use several different values of S and m. 6