Lomé Rainfall Data (1961-2015)

Donna Odhiambo & Austin Hardesty

Our group was tasked with making sense of the data provided to us by Togolose meteorologists of monthly and annual rainfall in Lomé, Togo spanning from years 1961-2015. To aid us in our analysis, we had preliminary work performed by two other groups concerning the monthly and annual surface temperatures in Lomé. For the annual data, the first group found a simple linear regression model to work best and for the monthly data, the second group found the best model fit to the data was a linear regression with sines and cosines. Our group will attempt to see if these trends extend from the surface temperatures into the rainfall data. 

Lomé is a coastal city located in the Maritime Region of Togo. It is both the capital and the administrative and industrial center of the country. It has a tropical savanna climate, which means we expect to see pronounced wet and dry seasons. For these kinds of climates, the wet season begins in May and goes on into September and the longer dry season takes up the rest of the year, wherein little rain falls. While we will be searching for these trends, we would not be surprised if the data deviates from them slightly because factors like latitude, topography, and coastal distance also play apart in determining the length of these two seasons. Speaking of, the latitude of Lomé is 6°8.2488’ N, the topography is one of a coastal plain full of marshes and lagoons, and Lomé is right on the coast of the Atlantic Ocean.

Annual Data

ListLinePlot[raw,PlotRange->All,AxesOrigin->{1,0},PlotLabel->"Stacked Annual Rainfall",AxesLabel->{"Months","rainfall (ml)"},Frame->True]

total=Flatten[Transpose[Import["C:\\Users\\odhia\\Downloads\\TOTAUXPLUVIOMETRIQUESMENSUELS1961-2015 (1).xls"][[2]]]];totPlot=ListPlot[total,AxesLabel->{"years","total rainfall"},PlotLabel->"Annual Total Rainfall",Frame->True]

In order to gain a sense of the yearly trends, two plots were made, one of every given year (1961-2015) of rainfall data superimposed titled “Stacked Annual Rainfall” and the other of just the annual total rainfalls titled “Annual Total Rainfall”. The plot with the stacked rainfall shows rainfall trends that are a bit atypical from what we would expect for a tropical savanna climate. While there does seem to be a pronounced wet season between May and September, there is also a rainfall spike around October as well after what would seem to be a dry month in August. The plot of the annual total rainfall has more variation exhibited than expected for annual rainfall, so to determine if a trend was evident we attempted a simple linear regression like the first group.

lm=LinearModelFit[total,{x,(x^2)},x,ConfidenceLevel->0.95]
lm["ParameterConfidenceIntervals"]
lm["ParameterTable"]
lm["RSquared"]

Show[totPlot,Plot[lm[x],{x,1,54},PlotStyle->Red]]
ListPlot[lm["FitResiduals"],Filling->Axis,AxesLabel->{"Fitted Value","Residual"},PlotLabel->"Residuals of Annual Total Rainfall Fit"]

A linear model regression of the annual rainfall in Lomé data of form y=a+bx shows that rainfall is decreasing over time, however the p-value was 0.417956, which is more than 0.05 so the coefficient of x was determined to be insignificant. Then a linear regression of y=a+bx+(cx^2) was used where, as shown, all coefficients are significant according to p-value, the confidence intervals show that none of the coefficients have the possibility of being zero, and the plot of residuals does not exhibit any apparent pattern. However, the (R^2) value is 0.13374, a number far from 1. The model, y=1090.8342950257318` -22.280605369914493` x+0.368029414588506` (x^2), shows that in the long run rainfall is increasing. SInce the previous group found that the surface temperatures in Lomé were increasing in their dataset, we were not surprised to find that so was the rainfall.

Monthly Data

We want to see if there is a better regression model that captures the periodicity shown in the rainfall of a tropical savanna climate. In order to first examine our dataset, we created a scatter plot of all of the monthly plots as well as a box and whisker chart of the months.

raw=Import["C:\\Users\\odhia\\Downloads\\TOTAUXPLUVIOMETRIQUESMENSUELS1961-2015 (1).xls"][[1]];
rawdata=Flatten[raw];
months=Table[i,{i,1, Length[rawdata]}];
data=Transpose[{months,rawdata}];
rainPlot=ListPlot[data,AxesLabel->{"months","rainfall"},PlotLabel->"Monthly Rainfall Scatter Plot",PlotRange->All,PlotTheme->"Scientific"]

trData=Transpose[raw];
BoxWhiskerChart[trData,{"Outliers",{"Outliers","●"},{"FarOutliers","○"}},ChartLabels->{"Jan","Feb","Mar","Apr","May","June","July","Aug","Oct","Sep","Nov","Dec"},ChartStyle->"Pastel",PlotLabel->"Box Whisker Charts of Individual Months"]

{q1,median,q3}=N[Quartiles[rawdata]];
iqr=q3-q1;
BoxWhiskerChart[rawdata,{"Outliers",{"Outliers","●"},{"FarOutliers","○"}},AspectRatio->1/10,ImageSize->1200,BarOrigin->Left,GridLines->{{{q3+1.5 iqr,Dashed},{q3+3 iqr,Dashed}},None},FrameTicks->{{None,None},{Automatic,{{q1,"q1"},{q3,"q3"},{q3+1.5 iqr,"near"},{q3+3 iqr,"far"}}}},PlotLabel->"Box Whisker Chart of All Rainfall Values"]

The scatter plot shows some issues right out of the gate, with several points lying ridiculously out of range of the other values. To determine that these point were not just points indicative of the wet season, a box whisker chart was created months data spanning the years. In this plot, the “far” outliers are shown in white and the “near” outliers are shown in black. Below that is a similar box whisker plot, except that it is of all of the rainfall values and all of the near and far outliers present throughout the dataset. In order to remove outliers and create a more comprehensive model for the data, IQR was used.

We used iqr method to determine outliers. With our method, we determined that there were 5 outliers that needed serious attention. Most of these can maybe be explained by typical extreme weather patterns that may occur every few years. One of our outliers was particularly strange. This one was September 1987.
OUTLIERS: 
June - 1962 - 696.4 
June - 1967 - 575.9
Sept - 1987 - 407.3
-This is the most mysterious outlier. September is historically a very dry month in Lome with the next highest rainfall year being September 2004 at 226.1 inches. September accounts for almost half of the yearly rainfall in Lome in 1987. This is very strange and it would be interesting to know why this anomaly occurred.
May - 1970 - 393.3
July - 1968 - 318.4

LM=LinearModelFit[data,{x,(x^2),Cos[2π x]},x,ConfidenceLevel->0.95]
LM["ParameterTable"]
LM["ParameterConfidenceIntervals"]
LM["RSquared"]

Show[rainPlot,Plot[LM[x],{x,1,660}]]

ListPlot[LM["FitResiduals"],Filling->Axis,AxesLabel->{"Fitted Value","Residual"},PlotLabel->"Residuals of Monthly Rainfall Fit"]
Histogram[LM["FitResiduals"],AxesLabel->{"Residual","Frequency"}]

A linear model regression of form y=a+bx did not seem to capture the periodicity apparent in the data, so a model of form y=a+bx+(cx^2) +d cos(2π x) was used in which all coefficients are significant according to p-value and the confidence intervals show that none of the coefficients have the possibility of being zero.While the scatterplot of residuals seems a bit noisy, the histogram of the residuals shows a non-normal distribution. The residuals are skewed to the left of zero in a pretty weighty fashion, so there is something this model is not catching, as shown by the very low (R^2) value of 0.00735554. The model,  y=45.1882 -0.15411497265968677` x+0.00021470835239282616` (x^2)+45.18822050230713` Cos[2 π x], shows that in the long run, rainfall is increasing, this coincides with what our group found for the yearly data. A linear regression was attempted with both sines and cosines, however, the coefficient for the sine term was not significant.

Conclusions

While our group concluded that rainfall is increasing over time, there were several things we did not consider in our surface level examination of the data presented to us. Such as the variables that affect rainfall in a given area. To fully understand the climate in Lomé, we would need data on air pressure, wind patterns, and humidity levels. Since Lomé is right on the coast, it is also imperative to know of any natural disasters, like tsunamis, hurricanes, typhoons, damaging storms, and even potentially earthquakes, as well as the time frame in which they occurred.
In the dataset, there are several months where 0.0 was recorded. It does make sense, since these values primarily occurred during dry months, but there are so many that it raises questions. Were these recorded accurately? Were there really that many months where it rained less than 0.1 mL in the entire city of Lomé? Lome does have some very dry months but it’s annual rainfall average is still 848.3 mL.