Mini-Project #1

Matthew Gall
Chris Milesky
Maria Ruwe

Kara is a northern city in Togo.

Below is the data for the average maximum temperature in Kara. The years range from 1977 - 2015. We shifted the years so that they range from 0 - 38:

yearsmax={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38};
moymax={33.1,32.7,33.1,33.3,33.5,32.9,33.7,33.4,33.1,33.3,34.4,33.5,33.2,33.7,33.2,33.2,33.2,33.6,33.9,34.0,33.6,34.4,33.9,33.9,34.5,34.2,34.1,33.9,34.1,34.5,34.0,33.9,34.2,34.5,34.8,33.9,33.8,34.3,34.7};
datamax=Table[{yearsmax[[i]],moymax[[i]]},{i,39}];

Below is the data for the average minimum temperature in Kara. The years range from 1977 - 2015. We shifted the years so that they range from 0 - 38:

yearsmin={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38};
moymin={21.3,21.0,21.3,21.6,21.0,21.1,21.4,21.0,21.3,21.0,21.5,21.1,20.1,20.2,20.6,19.3,20.7,20.1,21.3,21.4,21.3,21.6,20.9,20.9,21.0,20.8,21.6,21.4,21.6,21.8,21.6,21.2,21.7,21.8,21.7,21.5,21.6,22.1,21.8};
datamin=Table[{yearsmin[[u]],moymin[[u]]},{u,39}];

1) Discussion of Significant Increase

For our maximum temperature data and model, we determined that there is a significant increase in temperature in the average maximum temperature over time. We came to this conclusion because the coefficient for our linear regression equation for the maximum temperature of x is positive. So, the slope is positive and is increasing over time. Also, we looked at our t-statistic, which is around 7.57. This means that we are over seven standard deviations away from zero. Also, our p-value was extremely small: 5.010920924470413`*^-9. This means that the chances that the coefficient of x is zero is very slim. With this evidence, we were able to determine that there is a significant increase in average maximum temperature over time.

	 For our minimum temperature data and model, we chose a quadratic model. We also determined that there is a significant increase in average minimum temperature over time. We came to this conclusion because, even though the coefficient of the x term in the model is negative, the coefficient of the (x^2) term in the model is positive. So, the growth in the graph from the (x^2) term is going to be positive which means there will be a positive increase in the average minimum temperature over time. Also, by looking at our t-statistic, which is around 3.63, we can say that we are over 3 standard deviations away from zero. Also, our p-value is 0.000883576, which means that the chances that the coefficient of (x^2) is zero is very small. Using this evidence, we can determine that there is a significant increase for the average minimum temperature over time.

2) Discussion of Best Model for Maximum Temperature

For the maximum temperature, we determined that a linear model was the most appropriate model to use. We chose this model because the confidence interval did not include 0.Thus, we were confident that the x coefficients were not 0, which would make the whole term equal zero. When a quadratic model was created, the Parameter Confidence Interval was between -0.00130965 and 0.000640181. This allowed for the possibility that the quadratic term could equal zero. The linear model, which has a Parameter Confidence interval between 0.0266094 and 0.0460627, does not allow for the x term to be zero. Also, there was not a definite pattern in the graph of the residuals for a linear model. The fitted model equation is y= 33.084 +0.036336 x.

3) Graph of Model for Maximum Temperature

qm=LinearModelFit[datamax,{x},x]
Show[ListPlot[datamax],Plot[qm[x],{x,0,38}],Frame->True,PlotLabel->"Linear Model for Max Temp",FrameLabel->{"Year","Temperature"}]

qm["ParameterTable"]

4) Graph of Residuals for Maximum Temperature:

(* Let's have a look at the residuals : *)
ListPlot[qm["FitResiduals"], Filling->Axis,PlotLabel->"Residuals Plot for Max Temp",Axes->True,AxesLabel->{"Year","Temperature"}]

qm["ParameterConfidenceIntervals"] (* how did we do? *)

2) Discussion of Best Model for Minimum Temperature

For the minimum temperature, we determined that a quadratic model was the most appropriate model to use. We chose this model because the confidence interval did not include 0 for any of the x coefficients. Thus, we were confident that the x coefficients were not 0, which would make the whole term 0. In the linear model, the x term in the Parameter Confidence interval was between 0.00537955 to 0.0351468, which does not include zero. But, the residuals seemed to suggest that a higher ordered model may be a better fit as will be discussed later.  When a cubic model was created, the Parameter Confidence Interval was between -0.0000223081 to 0.014868 for the x squared term and between -0.000218615 to 0.0000387969 for the x cubed term. This allowed for the possibility that both the (x^2) term and the (x^3) could equal zero. The quadratic model, which has a Parameter Confidence Interval between 0.00101271 to 0.00358338, does not allow for the (x^2) term to be zero. Also, there was not a definite pattern in the residuals. So, we chose the quadratic as the best model to use for this data.

3) Graph of Model for Minimum Temperature

qmin=LinearModelFit[datamin,{x,x^2},x]
Show[ListPlot[datamin],Plot[qmin[x],{x,0,38}],Frame->True,PlotLabel->"Quadratic for Min Temp",FrameLabel->{"Year","Temperature"}]

qmin["ParameterTable"]

4) Graph of Residuals for Minimum Temperature:

ListPlot[qmin["FitResiduals"], Filling->Axis,PlotLabel->"Residuals for Min Temp",Axes->True, AxesLabel->{"Year","Temperature"}]

qmin["ParameterConfidenceIntervals"] (* how did we do? *)

5) Additional Information

One big concern that we had for our data is that the original data set had one of the average temperatures for 1993 recorded as 0 degrees Celsius. This was a huge drop from the typical average temperature which was in the low 20’s for most of the other years. We eventually did get a more believable temperature for 1993, but that still raised a lot of questions. Why was that zero even included in the data in the first place? Did a mistake happen with the tools that were being used to get a measure of 0 degrees? Also, how did they not catch their mistake when they were giving us the data set for Kara? These questions are not the only things we would like answers to. We would also like to know what the Togolese meteorologists mean when they say they are giving us the annual average. Is it the average of all of the low temperatures over the whole year or is it the average of all the low temperatures over each month or is it the average of all the low temperature over all of the days of the year? Knowing what they mean by average low would help us determine what precisely the data is telling us and how accurate and confident we can be in our results. Another question we would like to know from the Togolese meteorologists is what instrument they used to measure the temperatures? The data can definitely be affected and not be accurate or reliable if they were constantly using different instruments to collect the annual averages. It would also be very useful to know if the data was all collected in the same place. To have more accurate predictions, it may also be useful to have data points showing how big the difference is in the average maximum and minimum temperature in between the different seasons. If there is a big jump between two seasons or there is some outliers in the data, that could throw off the average minimum or average maximum temperature.