Mat 375 Mini Project 1: Sotouboua

Patrick Nielsen and Alyssa Farmer

Introduction

The goal of this analysis is to determine whether or not the temperatures in Sotouboua have been significantly increasing over the 34 years that the data was collected, from 1982 to 2015. The original time series data is plotted below, for both the minimum and maximum temperatures. At first glance, it looks like the minimum temperatures are generally increasing, but the maximum ones look like they are all over the place, and a trend is difficult to identify. Both of them look like they have a lot of variation, but a regression analysis is needed to determine whether or not there is a significant increase.

year=Table[x,{x,1,34}];
min={20.209384280594,20.6222855862775,20.1365640835496,20.1304175521302,19.7644585253456,19.5824276753712,20.1082545729823,19.4236617511521,19.5587141577061,19.9212314388121,19.5833333333333,20.1,19.9833333333333,20.1666666666667,20.1666666666667,20.3416666666667,20.8,20.4583333333333,20.2083333333333,20.25,19.9916666666667,18.3666666666667,18.1166666666667,20.6,19.9416666666667,20.0166666666667,19.95,20.4916666666667,20.9666666666667,20.8702777777778,21.1091666666667,21.7623333333333,21.4655555555556,20.9133333333333};
max={32.2419041218638,32.9168828018786,32.4552950809542,32.1493676326795,32.0309197388633,32.9861770353303,32.2852693115808,32.4843650793651,32.8039528929852,32.0666084229391,32.1916666666667,32.475,32.325,32.5333333333333,32.8666666666667,32.65,33.075,32.5833333333333,32.4416666666667,32.3583333333333,31.675,31.875,31.825,32.0916666666667,33.2916666666667,33.2666666666667,33.2083333333333,32.8666666666667,33.0222222222222,32.4430555555556,32.2055555555556,32.405,33.2158333333333,33.2502777777778};

mindata=Table[{year[[i]],min[[i]]},{i,34}];
maxdata=Table[{year[[i]],max[[i]]},{i,34}];

GraphicsRow[{ListPlot[mindata, PlotLabel -> "Sotouboua Min Temperatures"],
ListPlot[maxdata, PlotLabel -> "Sotouboua Max Temperatures"]}]

Simple Linear Regression: Minimum Temperatures

slrmin=LinearModelFit[mindata,x,x,ConfidenceLevel->.95]

pmin=ListPlot[mindata];

Show[pmin,Plot[slrmin[x],{x,0,35},PlotStyle->Red ],PlotLabel-> HoldForm[Sotouboua Min Temperatures],AxesLabel->{HoldForm[Years Since 1981],HoldForm[Degrees Celcius]}]

Below is a residual plot for the minimum temperatures from the linear model. There does not seem to be any strong pattern, and the residuals seem to be generally random. Looking at the parameter confidence intervals, in particular the one for the coefficient of x, it is easy to see that the interval does not contain zero. This provides evidence that the slope of the best fit line is positive, which is indicative of a significant increase in temperatures. However, the value of R^2 is 0.149, which means there is a lot of variation in the data that the model is not explaining. At this point, we know that there is at least a positive linear relationship between time and temperature, but more investigation is needed to see if a better model exists.

ListPlot[slrmin["FitResiduals"],Filling->Axis,PlotLabel->HoldForm[Min Residuals]]

slrmin["ParameterConfidenceIntervals"]

slrmin["RSquared"]

Quadratic Model: Minimum Temperatures

quadmin=LinearModelFit[mindata,{x,x^2},x, ConfidenceLevel->0.95]

Show[pmin,Plot[quadmin[x],{x,0,35},PlotStyle->Red ],PlotLabel-> HoldForm[Sotouboua Min Temperatures],AxesLabel->{HoldForm[Years Since 1981],HoldForm[Degrees Celcius]}]

ListPlot[quadmin["FitResiduals"],Filling->Axis,PlotLabel->HoldForm[Min Residuals]]

Above is a plot of the residuals for the quadratic model. Again, there do not appear to be any obvious issues. The quadratic term of the model appears to be significant, as it does not contain zero in the confidence interval for the coefficient of the x^2 term. Since this term is positive, it would again make sense to conclude that the minimum temperatures in Satouboua are increasing, although possibly not quite linearly. The quadratic model looks like it may fit the data a bit better, especially since the value of the R^2 term went from 0.149 in the linear model to 0.343 in the quadratic model. Although there is still a lot of variation unexplained by the model, the quadratic model still seems to be significantly better than the linear one.

quadmin["ParameterConfidenceIntervals"]

quadmin["RSquared"]

Simple Linear Regression: Maximum Temperatures

slrmax=LinearModelFit[maxdata,x,x,ConfidenceLevel->.95]

pmax=ListPlot[maxdata];
Show[pmax,Plot[slrmax[x],{x,0,35},PlotStyle->Red],PlotLabel-> HoldForm[Sotouboua Max],AxesLabel->{HoldForm[Years Since 1981],HoldForm[Degrees Celcius]}]

ListPlot[slrmax["FitResiduals"],Filling->Axis,PlotLabel->HoldForm[Max Residuals]]

The plot of the residuals for the linear model can be seen above. The residuals are quite obviously randomly distributed with constant variance, so there are again no issues here.The confidence interval for the coefficient on the x term contains zero, which indicates that we do not have significant evidence at the 0.05 significance level that there is a positive linear relationship between time and temperature. The value for R^2 is also 0.08, which is very low. We therefore are unable to say that the maximum temperatures in Satouboua are increasing by a significant amount.

slrmax["ParameterConfidenceIntervals"]

slrmax["RSquared"]

The data provided to us had quite a bit of variation in it, so there was no noticeable trend, especially in the maximum temperatures. We have found that the minimum temperatures in Sotouboua have likely been increasing, and the relationship between time and temperature can be modeled with a quadratic model. However, there was not significant evidence for maximum temperatures increasing with the data we have currently. looking at the raw data the average temperatures that we observed had different amount of decimals leading me to question the number of times and places in Sotouboua the temperature was recorded throughout the year. there are average temperatures less that 4 years apart (leap years) that the number of temperatures recordings would have to been divisible by a factor of 3.