I have a daily rainfall data measured in (cm), i have put some threshold and derived a categorical variable whether it is a rainy day or a dry day.
From this data i want to calculate Probability of a future day given last n-days, e.g.
what is the probability of a day being a rainy day given last 3 days were rainy day? there can be four instances -

  1. P(rainy day| previous 3 rainy days) ?
  2. P(rainy day| previous 3 dry days) ?
  3. P(dry day | previous 3 rainy days) ?
  4. P(dry day | previous 3 dry days) ?


  • $\begingroup$ This is confusing: what would instances (2) and (4) have to do with the question, given that they concern the situation where the previous three days were dry rather than rainy? $\endgroup$
    – whuber
    Commented Mar 29, 2019 at 13:58

1 Answer 1


Use conditional probability here. For instance if you want to calculate a rainy day given 3 rainy days find ratio of P(3rainy days and 4th rainy day) to P(3rainy days). For numerator count all the cases of 4 consecutive days such that all four are rainy. For denominator count all cases such that 3consecutive days are rainy. Hope this helps you


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.