From table, we can observe weather changes probability. In first column, we have today's weather, while in other columns tomorrow's weather probabilities given today one. For example:
If today is Sun, then tomorrow is:
- Sun with probability 0.6
- Cloudy with probability 0.3
- Rain with probability 0.1
A stationary distribution tells us the long-run probabilities of being in each weather state. But first, let's find out what happens the next day, that is:
- P(Sun tomorrow)
- P(Cloudy tomorrow)
- P(Rainy tomorrow)
Let's look at P(Sun tomorrow). Tomorrow can be sunny in 3 ways:
- if today is Sun and stays Sun (with probability 0.6)
- if today is Cloudy and changes to Sun (with probability 0.4)
- if today is Rain and changes to Sun (with probability 0.1)
Then we can find P(Sun tomorrow) like in below equation:
P(Sun tomorrow) = P(Sun today) * 0.6 + P(Cloud today) * 0.4 + P(Rain today) * 0.1 (1)
Now for other two conditions it becomes:
P(Cloud tomorrow) = P(Sun today) * 0.3 + P(Cloud today) * 0.2 + P(Rain today) * 0.4 (2)
P(Rainy tomorrow) = P(Sun today) * 0.1 + P(Cloud today) * 0.4 + P(Rain today) * 0.5 (3)
Now we return to the idea of a stationary distribution. It represents a situation where, after one transition, the overall probabilities do not change. In simple words, the long-run percentages of sunny, cloudy, and rainy days stay the same. Mathematically we can show stationary distribution v:
v = (x, y, z)
where,
- x = probability of Sun
- y = probability of Cloudy
- z = probability of Rain
From above definition of stationary distribution, mathematically we can show it as:
vP=v
which satisfies the claim "after one transition, the distribution stays unchanged."
Now let's simplify equations (1), (2), and (3) with simplier variables x, y, z. Then equation becomes:
- x=0.6 * x+0.4 * y+0.1 * z --> 0.4x−0.4y−0.1z=0 (4)
- y=0.3 * x+0.2 * y+0.4 * z --> −0.3x+0.8y−0.4z=0 (5)
- z=0.1 * x+0.4 * y+0.5 * z --> −0.1x−0.4y+0.5z=0 (6)
where x + y + z = 1, as all probabilities must add up to 1.
Subsituting equation:
0.4x−0.4y−0.1z=0 --> 0.4x−0.4y=0.1z --> z=4x−4y
Replace z in equation (5):
−0.3x+0.8y−0.4(4x−4y)=0 --> −1.9x+2.4y=0 --> y= (19/24)x
Replace y in z = 4x - 4y:
z=4x−4((19/24) * x) --> z=4x−(76/24)x --> z=5/6 * x
Now recall that, x + y + z = 1, by probability definition. Then:
x+ (19/24) * x+(5/6) * x=1 --> x = 8 / 21 ~ 0.381
Now find y and z, by plugging x in them:
y=19/24 * x = 19 / 63 ~ 0.302
z=5/6 * x = 20 / 63 ~ 0.317
Thus, v = (0.381, 0.302, 0.317)