Markov Chains

Every day for lunch you have either a sandwich (state 1), a burrito (state 2), or pizza (state 3). Suppose your lunch choices from one day to the next follow a Markov chain with transition matrix

P=[00.50.50.10.40.50.20.30.5]

Suppose today is Monday and consider your upcoming lunches.

Write code to setup and run a simulation to investigate the following.

  1. Approximate the marginal distribution, along with the expected value and standard deviation, of each of the following
    1. X4
    2. T
    3. V
    4. W
  2. Approximate the joint distribution, along with the correlation, of each of the following
    1. X4 and X5.
    2. T and V
    3. T and W
    4. W and V
  3. Approximate the conditional distribution of V given T=4, along with its (conditional) mean and standard deviation.
  4. Your choice. Choose at least one other joint, conditional, or marginal distribution to investigate. You can work with Xn,T,V,W, but you are also welcome to define other random variables in this context. You can also look at time frames other than a single week.

For each of the approximate distributions, display the results in an appropriate plot, and write a sentence or two describing in words in context some of the main features.