# Algorithmically Determining the Rainy Season

I have historical precipitation data for hundreds of cities around the world. I would like to algorithmically determine when the rainy season (if exists) is for each location. Are there any algorithms out there that can determine this based on the monthly averages alone?

Some problems that I envision are:

• Having a lot of rain is not enough. Many places in south east asia have very heavy rain falls for a couple of minutes a day, but it still is not necessarily considered rainy season.
• Is it better to say that if the weather is x standard deviations above the average precipitation that it is rainy season or use a moving average?
• Any other ideas, links, etc?

I'm brand new to the field so help and an open discussion would be appreciated.

This is an interesting statistics problem. I would do this for starters. Take all the years of data and calculate average rainfall amounts for each day of the year. If you're looking for the rainy season, I would use maybe a 30-day moving average on this, but make sure that the average can wrap around Jan 1. Once you have these values -- 365 values for each site -- I suggest trying a few things:

1) Try out the standard deviation approach. It's easy to calculate, so you should be able to play around with the particular number "x" in "x standard deviations above the mean". If it works for you, there's no reason to make it harder.

2) Using "x standard deviations above the mean" really just means that you're looking for a certain value of the cumulative distribution function (CDF) of rainfall. Instead of using standard deviation, you could calculate these CDFs for each site from those 365 values, and pick the 75th percentile or something. I'm still thinking through whether this would guarantee that you get a "season"; it's possible that the top-percentile values of the year are nowhere near each other.

3) Plot out a few distributions for key sites: dry midlatitudes, wet midlatitudes, polar, tropics (monsoon-dominated). If these PDFs look pretty similar, you might be able to figure out a sensible approach.

I think the key difficulty here isn't going to be that different places have different total rainfall, but that different places can have rainy seasons of different lengths. If the season was always 30 days, I think this approach would be fine. I'm really interested in seeing those CDFs just to see how different they are.

Let us know what you come up with!

• I would be careful using the standard deviation with rainfall, because rainfall typically has extreme events and is therefore far from normally distributed. I would use a more robust alternative such as the median absolute deviation. People at Cross Validated might have more rigorous answers on the statistics side of things.
– gerrit
Jun 29, 2015 at 13:03
• I think the length of the rainy season is the issue. So you need to consider the correlation to rain in previous and subsequent days. A large rain event in the dry season can occur but can be short-lived. Potentially the amount of rain is less significant - you can have seasons of lots of days with light rain (think Seattle or London). In that sense, monthly data might not be sufficient. Jul 1, 2015 at 22:51
• I agree with @haresfur. I was talking with someone today about this, and they brought up that it might be an ill-posed problem. Does every site even have a rainy season? She mentioned her home country of Norway as having precipitation (if not rain) distributed pretty evenly throughout the year. Jul 2, 2015 at 0:16

Maybe you can try Fourier Analysis - https://en.wikipedia.org/wiki/Fourier_analysis to distinguish certain patterns. There are papers on using this method to identify rainfall and pollution periodicity. For example, weekend effect on urban pollution. I can't think of any papers right now, but I am sure you can find something.

The approaches, based on the negative binomial model for the distribution of duration of the wet periods measured in days, are proposed to the definition of extreme precipitation. This model demonstrates excellent fit with real data and provides a theoretical base for the determination of asymptotic approximations to the distributions of the maximum daily precipitation volume within a wet period as well as the total precipitation volume over a wet period. The first approach to the definition (and determination) of extreme precipitation is based on the tempered Snedecor–Fisher distribution of the maximum daily precipitation. According to this approach, a daily precipitation volume is considered to be extreme, if it exceeds a certain (pre-defined) quantile of the tempered Snedecor–Fisher distribution. The second approach is based on that the total precipitation volume for a wet period has the gamma distribution. Hence, the hypothesis that the total precipitation volume during a certain wet period is extremely large can be formulated as the homogeneity hypothesis of a sample from the gamma distribution. Two equivalent tests are proposed for testing this hypothesis. Both of these tests deal with the relative contribution of the total precipitation volume for a wet period to the considered set (sample) of successive wet periods. Within the second approach it is possible to introduce the notions of relatively and absolutely extreme precipitation volumes. The results of the application of these tests to real data are presented yielding the conclusion that the intensity of wet periods with extreme large precipitation volume increases.

Statistical tests for extreme precipitation volumes by V. Yu. Korolev1, A. K. Gorshenin2 , K. P. Belyaev3, 29 Nov 2018