Markov chain: Sunny or raining?

818 Views Asked by At

Suppose that the probability that it rain today is $p=0.3$ if neither of the last two days was rainy, but $0.6$ if at least one of the last two days was rainy. Let the wether at the $n^{th}$ day, $W_n$, be $R$ for rain and $S$ for sunny. $W_n$ is not a markov chain but the weather for the last two day $X_n=(W_n,W_{n-1})$ is a Markov chain with four states $\{RR,RS,SR,SS\}$. Compute it's transition probability.

I have that $$p\{X_{n+1}=RR\mid X_n=RR\}=p\{W_{n+1}=R\mid W_n=R,W_{n-1}=R\}=0.6.$$

I would say that $$p\{X_{n+1}=RR\mid X_n=RS\}=p\{W_{n+1}=R,W_n=R\mid W_n=R,W_{n-1}=S\}=p\{W_{n+1}=R\mid W_n=R,W_{n-1}=S\}=0.6$$

and

$$p\{X_{n+1}=RR\mid X_n=SR\}=p\{W_{n+1}=R,W_n=R\mid W_n=S,W_{n-1}=R\}=0$$

because it's impossible that $W_n=R$ and $W_n=S$, but in the correction of my exercise, they say exactly the opposite, i.e. $p\{X_{n+1}=RR\mid X_n=RS\}=0$ and $p\{X_{n+1}=RR\mid X_n=SR\}=0.6$. Then who is right ? (thanks to give me some explanation if they are right because I don't understand why).

1

There are 1 best solutions below

0
On

WARNING: This is post may seem long, but I just presented the answer in a way that I thought would be most easy to read. Hope it helps clear up some confusion.

I'm not sure how you're classifying your states so for clarity by Xn = RS I mean Wn-1 = R and Wn = S.

Now to map the behavior of the weather based on given information we can say:

P(Wn = R) = 0.3 if Xn-1 = SS

P(Wn = R) = 0.6 if Xn-1 = (SR or RS or RR)

Therefore we can conclude:

P(Xn = SS|Xn-1 = SS) = P(Wn = S|Xn-1 = SS) = 0.7

P(Xn = SR|Xn-1 = SS) = P(Wn = R|Xn-1 = SS) = 0.3

P(Xn = RS|Xn-1 = SS) = 0

P(Xn = RR|Xn-1 = SS) = 0

P(Xn = SS|Xn-1 = SR) = 0

P(Xn = SR|Xn-1 = SR) = 0

P(Xn = RS|Xn-1 = SR) = P(Wn = S|Xn-1 = SR) = 0.4

P(Xn = RR|Xn-1 = SR) = P(Wn = S|Xn-1 = SS) = 0.6

P(Xn = SS|Xn-1 = RS) = P(Wn = S|Xn-1 = RS) = 0.4

P(Xn = SR|Xn-1 = RS) = P(Wn = R|Xn-1 = RS) = 0.6

P(Xn = RS|Xn-1 = RS) = 0

P(Xn = RR|Xn-1 = RS) = 0

P(Xn = SS|Xn-1 = RR) = 0

P(Xn = SR|Xn-1 = RR) = 0

P(Xn = RS|Xn-1 = RR) = P(Wn = S|Xn-1 = RR) = 0.4

P(Xn = RR|Xn-1 = RR) = P(Wn = R|Xn-1 = RR) = 0.6

From this information it is easy to build a transition probability matrix.