You are on page 1of 7

Time Series Annual Average Temperature for Miami from 1949 to 2011

Maryam Aljahani

Min. 1st Qu. Median Mean 3rd Qu. Max.

73.96 75.47 76.16 76.27 77.12 78.25

78
77
Temp(F)

76
75
74

1950 1960 1970 1980 1990 2000 2010

Year

The time series looks non-stationary. We will test stationarity using Dickey-Fuller test.

Augmented Dickey-Fuller Test

data: Annts
Dickey-Fuller = -2.9583, Lag order = 3, p-value = 0.1869
alternative hypothesis: stationary

The above test indicates that the series are non-stationary. We will take the first difference of the series
and re-test
2
1
Anntslag1

0
-1
-2

Time

Augmented Dickey-Fuller Test

data: Anntslag1
Dickey-Fuller = -5.9509, Lag order = 3, p-value < 0.01
alternative hypothesis: stationary

Series Anntslag1
0.8 1.0
0.6
0.4
ACF

0.0 0.2
-0.4

0 5 10 15

Lag
Series Anntslag1
0.2
0.1
Partial ACF

0.0
-0.3 -0.2 -0.1

5 10 15

Lag

The correlogram for the ACF has a lag 1 significant autocorrelation.

The correlogram for the ACF has a lag 1,2 and 3 significant partial autocorrelation.

The correlograms suggest that an ARMA (1,1) could be a good fit for the differentiated series since the
ACF shows an oscillating decay beginning at lag 1, and the PACF decay beginning at lag 1. (See Table
2.1 in Enders). Therefore the original time series could be modeled with ARIMA(1,1,1)

Model Selection, Fitting and Diagnostics

We will use fit an ARIMA (1,1,1) model to the original series ( since the differentiated series seems to be
ARMA(1,1) )

Series: Annts
ARIMA(1,1,1)

Coefficients:
ar1 ma1
0.0794 -0.7740
s.e. 0.1686 0.1044

sigma^2 estimated as 0.6439: log likelihood=-73.7

AIC=153.4 AICc=153.82 BIC=159.79

∆𝑌𝑡 = 0.0794 ∗ ∆𝑌𝑡−1 − 0.7740 ∗ 𝜀𝑡−1 + 𝜀𝑡

Residuals from ARIMA(1,1,1)

-1

1950 1960 1970 1980 1990 2000 2010

0.2 15

0.1
10

count
ACF

0.0

-0.1 5

-0.2
0
5 10 15 -2 -1 0 1 2
Lag residuals

Ljung-Box test

data: Residuals from ARIMA(1,1,1)

Q* = 7.5688, df = 8, p-value = 0.4767

Shapiro-Wilk normality test

data: modeloo\$residuals
W = 0.98541, p-value = 0.6616

From the ACF correlogram of the residuals we can observe that there is no significant correlation left
between the residuals once we have fitted an ARIMA (1,1,1) to the series. Box-Ljung test showed no
significant overall correlation. Also, the histogram of the residuals looks bell shaped symmetric.
A Shapiro-Wilk normality test on the residuals shows no departure from normality.
Therefore we can conclude that the residuals are a Gaussian white noise. This validates the fit of the
ARIMA (1,1,1) model for the time series for the Average Annual Temperatures in Miami.
Finding model with lowest AIC

We will use the auto.arima() function in R to execute an automatic search for the ARIMA (p,d,q) with
the lowest AIC. Although an ARIMA(1,1,1) seems a good fit to our data , the AR(1) coefficient is not
̂ −0
𝜑 0.0794
statistically significant ( 𝑧 = 𝑆𝐸(𝜑) = 0.1686 = 0.471 , 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.637 ) , so maybe a model
with p=0 would be a better one.

Series: Annts
ARIMA(0,1,1)
Coefficients:
ma1
-0.7404
s.e. 0.0901

sigma^2 estimated as 0.6356: log likelihood=-73.81

AIC=151.63 AICc=151.83 BIC=155.88

The algorithm picked ARIMA(0,1,1) as the best fit , and as predicted the AR(1) term was not
retained.

We can also see that both the AIC and BIC of the ARIMA(0,1,1) are lower than those of the
previous model ARIMA(1,1,1) indicating an improvement in fit
Residuals from ARIMA(0,1,1)

-1

1950 1960 1970 1980 1990 2000 2010

0.2 15

0.1
10
count
ACF

0.0

-0.1 5

-0.2
0
5 10 15 -2 -1 0 1 2
Lag residuals

Ljung-Box test

data: Residuals from ARIMA(0,1,1)

Q* = 7.852, df = 9, p-value = 0.5491
Model df: 1. Total lags used: 10

Shapiro-Wilk normality test

data: modelopt\$residuals
W = 0.98608, p-value = 0.6976

Again the residuals are uncorrelated and normality distributed, therefore they are a Gaussian white noise.
This validates the ARIMA(0,1,1) model as a good fit for the time series of the Average Annual
Temperatures in Miami.

Therefore, we can use ARIMA(0,1,1) as the model for our data , as such :

Or equivalently,

Forecasts

The data set used ( available at http://www.sercc.com/cgi-bin/sercc/cliMAIN.pl?fl5663 ) runs only up to

2011 . We will forecast with both models and compare with the actual average annual temperatures
reported for Miami between 2012 and 2018

Forecasts using ARIMA(1,1,1)

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
2012 77.42033 76.39198 78.44868 75.84760 78.99305
2013 77.35443 76.27917 78.42969 75.70997 78.99890
2014 77.34920 76.24356 78.45484 75.65827 79.04013
2015 77.34878 76.21459 78.48298 75.61418 79.08338
2016 77.34875 76.18678 78.51072 75.57167 79.12583
2017 77.34875 76.15966 78.53784 75.53019 79.16731
2018 77.34875 76.13314 78.56435 75.48964 79.20786

Forecasts using ARIMA (0,1,1)

Point Forecast Lo 80 Hi 80 Lo 95 Hi 95
2012 77.34672 76.32502 78.36841 75.78417 78.90927
2013 77.34672 76.29115 78.40229 75.73237 78.96107
2014 77.34672 76.25833 78.43511 75.68217 79.01127
2015 77.34672 76.22647 78.46697 75.63345 79.05999
2016 77.34672 76.19549 78.49794 75.58607 79.10737
2017 77.34672 76.16533 78.52811 75.53994 79.15350
2018 77.34672 76.13591 78.55752 75.49495 79.19849
79
Forecasts from ARIMA(0,1,1) Forecasts from ARIMA(1,1,1)

79
78

78
77

77
76

76
75

75
74

74
1950 1970 1990 2010 1950 1970 1990 2010

Model1 Model2
Year Actuals Forecast ARIMA(1,1,1) Forecast ARIMA(0,1,1)
2012 77.3 77.4200 77.3467
2013 77.9 77.3540 77.3467
2014 77.5 77.3490 77.3467
2015 79.1 77.3488 77.3467
2016 78.1 77.3488 77.3467
2017 78.1 77.3488 77.3467
2018 77.7 77.3488 77.3467