if (FALSE) {
library(xts) # assumes package has been installed
plot(lap.xts$Cmort, col=4)
lapw = apply.weekly(lap.xts, FUN=colMeans) # get weekly averages
plot(lapw[,c('Cmort', 'Temp', 'Part')], col=astsa.col(2:4, .7), main=NA)
addLegend(col=2:4, lty=1, lwd=2, ncol=3, bty="white")
sarima(lapw$Cmort, 0,1,1, no.constant=TRUE) # fit ARIMA(0,1,1) to weekly Cmort
}
Run the code above in your browser using DataLab