1.Explore the data

x <- read.table(file="http://ionides.github.io/531w16/intro/ann_arbor_weather.csv",header=TRUE)
x1 <- na.omit(x)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -22.000  -7.750  -3.000  -2.833   2.000  19.000


2.Fitting an ARMA model

ar1 <- arima(x1$Low, order=c(1,0,0))
ar1
## 
## Call:
## arima(x = x1$Low, order = c(1, 0, 0))
## 
## Coefficients:
##          ar1  intercept
##       0.0217    -2.8363
## s.e.  0.0943     0.6992
## 
## sigma^2 estimated as 53.34:  log likelihood = -388.43,  aic = 782.86
ma1 <- arima(x1$Low, order=c(0,0,1))
ma1
## 
## Call:
## arima(x = x1$Low, order = c(0, 0, 1))
## 
## Coefficients:
##          ma1  intercept
##       0.0196    -2.8360
## s.e.  0.0897     0.6974
## 
## sigma^2 estimated as 53.34:  log likelihood = -388.44,  aic = 782.87

3.Testing for Normality

qqnorm(x1$Low)
qqline(x1$Low)

shapiro.test(x1$Low)
## 
##  Shapiro-Wilk normality test
## 
## data:  x1$Low
## W = 0.99149, p-value = 0.7062

4.Inference on \(\mu\)

arma00 <- arima(x1$Low, order=c(0,0,0))
arma00
## 
## Call:
## arima(x = x1$Low, order = c(0, 0, 0))
## 
## Coefficients:
##       intercept
##         -2.8333
## s.e.     0.6842
## 
## sigma^2 estimated as 53.37:  log likelihood = -388.46,  aic = 780.92

5. Diagnostics

plot(arma00$resid, ylab="residuals")

acf(arma00$resid,na.action=na.pass,main="ACF of residuals")


6.Summary