Predict Weather Using Markov Chains

markov chainsprobability

I got the following problem and solution from a slide in my Master's Analytic course, but it looked different from what I have learned about Markov Chain so far.

Problem:

Let $X_{i}=0$ if it rains on day $i$, otherwise $X_{i}=1$. Given a probability state transition matrix:

$$
\mathbf{P}=
\begin{pmatrix}
P_{00} & P_{01} \\
P_{10} & P_{11}
\end{pmatrix}
=
\begin{pmatrix}
0.7 & 0.3 \\
0.4 & 0.6
\end{pmatrix}
$$

Suppose that it rains on Monday, predict the weather for the rest of the work week.

My Solution:

I simply compute like the following, with $i=0,1,2,…$ correspond to Monday, Tuesday, … respectively:

$$
\begin{Bmatrix}
P(X_{i}=0) \\
P(X_{i}=1)
\end{Bmatrix}
=
\begin{Bmatrix}
1 \\
0
\end{Bmatrix}^{T}
\begin{pmatrix}
0.7 & 0.3 \\
0.4 & 0.6
\end{pmatrix}^{i}
$$

The Slide's Solution

The solution gives the following table

Solution Table

I am not sure what $U_{i}$ is and why we compare it with $P_{\cdot 0}$ to predict the weather. Does anyone know why we solve it like this?

Best Answer

I think that what the slide is doing is sampling from the Markov chain: randomly picking one possible way that the weather could go for the week, following the transition probabilities. The $U_i$ are just random numbers uniformly chosen from the interval $[0,1]$. Under this interpretation, here is how we read the table:

  1. Since it rained on Monday, the probability of rain on Tuesday is $P_{00}=0.7$. To simulate a probability of $0.7$, we pick $U_1 \in [0,1]$: if $U_1 < 0.7$, it will rain, and if $U_1 > 0.7$, it will be sunny. We get $U_1 = 0.62$, so it rains on Tuesday.
  2. Since it rained on Tuesday, the probability of rain on Wednesday is $P_{00}=0.7$. To simulate a probability of $0.7$, we pick $U_2 \in [0,1]$: if $U_2 < 0.7$, it will rain, and if $U_2 > 0.7$, it will be sunny. We get $U_2 = 0.03$, so it rains on Wednesday.
  3. Since it rained on Wednesday, the probability of rain on Thursday is $P_{00}=0.7$. To simulate a probability of $0.7$, we pick $U_3 \in [0,1]$: if $U_3 < 0.7$, it will rain, and if $U_3 > 0.7$, it will be sunny. We get $U_3 = 0.77$, so it's sunny on Thursday.
  4. Since it was sunny on Thursday, the probability of rain on Friday is $P_{10} = 0.4$. To simulate a probability of $0.4$, we pick $U_4 \in [0,1]$: if $U_4 < 0.4$, it will rain, and if $U_4 > 0.4$, it will be sunny. We get $U_4 = 0.91$, so it's sunny on Friday.

This is different from predicting the weather. I think that the matrix powers you are taking are a better fit for that question: they will tell you that

  1. On Tuesday, there is a $0.7$ probability of rain and an $0.3$ probability of sunshine.
  2. On Wednesday, there is a $0.61$ probability of rain and a $0.39$ probability of sunshine.

and so on.