# 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. Now, set up the transition probability for the state "Nice" as shown below. Then, click Proceed. This time, you are asked to set the transition probabilities for the state "Rain". Let's do that as shown below. 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. Now, click proceed and in the next screen, click "Finish". Then you will get a Markov chain model generated for you as shown here. 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%. Finally, from the View menu, select the Decision Graph to see the Markov Chain Diagram. Last updated on Feb 17, 2022