Weather forecasting using Markov Chain

This is a very common and traditional Weather forecast example. Here is the scenario.

1. It is almost impossible to have two nice days in a row

2. If we have a nice day, we are just as likely to have snow or rain the next day

3. If we have snow or rain, then we have an even chance to have the same the next day

4. If there is a change from snow or rain, only half of the time is this a change to a nice day.

Question: if it is nice today, what is the probability of being nice after one week?

We can find out. Let's start the SpiceLogic Markov Chain Calculator software and enter the three states "Nice", "Rain" and "Snow" and then click Proceed.

Markov Chain Calculator wizard with the three weather states Nice, Rain, and Snow entered for the classic weather forecasting Markov chain example.

Now, set up the transition probability for the state "Nice" as shown below.

Markov Chain Calculator wizard setting transition probabilities from the Nice state to Nice, Rain, and Snow, encoding the rule that two nice days in a row is unlikely.

Then, click Proceed. This time, you are asked to set the transition probabilities for the state "Rain". Let's do that as shown below.

Markov Chain Calculator wizard setting transition probabilities from the Rain state to Nice, Rain, and Snow according to the weather forecasting scenario rules.

Then click Proceed and then you will be asked to enter the transition probability of the last state "Snow". Let's do that as shown below.

Markov Chain Calculator wizard setting transition probabilities from the Snow state to Nice, Rain, and Snow according to the weather forecasting scenario rules.

Now, click proceed and in the next screen, click "Finish". Then you will get a Markov chain model generated for you as shown here.

Markov Chain Calculator result view of the Nice, Rain, Snow weather model, showing about 20% probability of nice weather a week after a nice day.

So, we get the answer. After a week, the chance of getting nice weather is 20% if it is nice today.

You don't need to stop there. You can do further analysis. What about the chance of not raining after a week? Use the expression editor to set expression NOT Rain and click the Chart tab to see the prediction. Looks like not getting rain after a week is 60%.

Markov Chain Calculator custom expression NOT Rain applied to the weather model, with the Chart tab showing roughly 60% probability of not raining a week later.

Finally, from the View menu, select the Decision Graph to see the Markov Chain Diagram.

Markov Chain Calculator cyclic decision graph of the Nice, Rain, Snow weather chain with labelled transition probability arrows between the three weather states.


Last updated on Jan 7, 2026