Weather transition matrix

720 Views Asked by At

Based on observation, I've gathered some data:

Day 1 2 3 4 5 6 7 8 9 10
    S R S F S R F F R S

(S) = Sunny (R) = Rainy (F) = Foggy

How do I construct this into a transition matrix, for markov chain ?

S R F S[? ? ?] R[? ? ?] F[? ? ?]

Thanks

2

There are 2 best solutions below

2
On BEST ANSWER

There are $9$ transitions. To fill in the appropriate entries, count the number of relevant transitions.

So for the entry in row S, column S, count the number of two consecutive days where you have S,S.

For row S, column R, coin the number of two consecutive days where you have S then R.

For row S, column F, coin the number of two consecutive days where you have S then F.

Once you have evaluated the number of transitions for all $9$ entries, divide each row by the total number of entries in that row.

I have filled in part of the matrix below:-

   S   R    F
 S[0   2/3  1/3]
 R[2/3  0   1/3]
 F[1/3 1/3  1/3]

Can you complete the transition matrix?

3
On

Well first we'll work out our transition probabilities:

Let the weather on day n be $W_n$, then (taking the date given to be perfectly accurate) we have that $$\mathbb{P} (W_{n+1} = S | W_n = S) = 0 \\ \mathbb{P} (W_{n+1} = R | W_n = S) = 2/3 \\ \mathbb{P} (W_{n+1} = F | W_n = S) = 1/3 $$ And we get this just by looking at the data, and looking at what happens the day after a sunny day. We ignore the last day because we don't know what happens after the sunny day on day 10.

We also get

$$\mathbb{P} (W_{n+1} = S | W_n = R) = 2/3 \\ \mathbb{P} (W_{n+1} = R | W_n = R) = 0 \\ \mathbb{P} (W_{n+1} = F | W_n = R) = 1/3 $$ And $$ \\ \mathbb{P} (W_{n+1} = S | W_n = F) = 1/3 \\ \mathbb{P} (W_{n+1} = R | W_n = F) = 1/3 \\ \mathbb{P} (W_{n+1} = F | W_n = F) = 1/3 $$

So let $P$ be our transition matrix, then we're going to use the convention that we multiply with the transition matrix on the left so that if $\mathbf{w}_n$ is our probability distribution for $W_n$ then $$\mathbf{w}_{n+1} = P\mathbf{w}_n $$

Then labeling $S_1 := S, S_2 := R, S_3 := F$ we have that $$ P = [p_{i,j}] = \mathbb{P} (W_{n+1} = S_j | W_n = S_i) $$ And then we can easily insert the values we had earlier to get

$$ P = \begin{pmatrix} 0 & 2/3 & 1/3 \\ 2/3 & 0 & 1/3 \\ 1/3 & 1/3 & 1/3 \end{pmatrix} $$