Question: 1. Simulate a Markov chain X(t) such that, X(0) = 0, for each t =1,2,...,n, X(t+1) = X(t)+1 with probability p and X(t+1) = X(t)
1. Simulate a Markov chain X(t) such that, X(0) = 0, for each t =1,2,...,n, X(t+1) = X(t)+1 with probability p and X(t+1) = X(t) - 1 with probability 1-p.
a. What is the state space of this chain?
b. Simulate for n= 1000 and p = 0.5. Simulate 100 such chains and store the value of X(n) (for each of the 100 repetitions) in an array/matrix. Plot the histogram of the 100 X(n) values and also print the summary statistic of X(n) (N, mean, std dev, median, min and max).
c. Now simulate for n = 1000 and p=0.3. Again repeat this 100 times and store the value of X(n). Plot the histogram of the 100 X(n) values and also print the summary statistic of X(n).
d. Now simulate for n = 1000 and p=0.8. Again repeat this 100 times and store the value of X(n). Plot the histogram of the 100 X(n) values and also print the summary statistic of X(n).
e. Has the distribution of X(n) stayed the same in (b), (c) and (d)? Describe your observation and explain why (hint: look at the properties of the Markov chains that you have studied).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
