\chapter{Time Series Models} \label{chap:timeseriesmodels} \SweaveOpts{keep.source=TRUE, pdf=FALSE, prefix.string=Chap10, grdevice=tikz.Swd} <>= options(digits=3, show.signif.stars=FALSE, width=53) rm(list=ls()) require(tikzDevice) source("../SweaveTikZ.R") @ %data files used: load("annual.RData"); load("best.use.RData"); read.table("SST.txt", T) %required packages: gamlss, xtable, chron, reshape, ggplot2, netork, sna, igraph %source code: source("get.visibility.R") \begin{quote} ``A big computer, a complex algorithm and a long time does not equal science.'' \end{quote} \indent---Robert Gentleman\\ In this chapter we consider time series models. A time series is an ordered sequence of numbers with respect to time. In climatology you encounter time-series data in a format given by \begin{equation} \{h\}^T_{t=1} = \{h_1, h_2, \ldots, h_T\} \end{equation} where the time $t$ is over a given season, month, week, day and $T$ is the time series length. The aim is to understand the underlying physical processes. A trend is an example. Often by simply looking at a time series you can pick out a significant trend that tells you that the process generating the data is changing. But why? A single time series only gives you one sample from the process. Yet under the ergodic hypothesis a time series of infinite length contains the same information (loosely speaking) as the collection of all possible series of finite length. In this case you can use your series to learn about the nature of the process. This is analogous to spatial interpolation of Chapter~\ref{chap:spatialmodels}, where the variogram is computed under the assumption that the rainfall field is stationary. Here we consider a selection of techniques and models for time series data. We begin by showing you how to over lay plots as a tool for exploratory analysis. This is done to qualitatively compare the variation between two series. We demonstrate large variation in hurricane counts arising from a constant rate process. We then show techniques for smoothing your series. We continue with a change-point model and techniques for decomposing a continuous-valued series. We conclude with a unique way to create a network graph from a time series of counts and suggest a new definition of climate anomalies. \section{Time Series Overlays} \label{sec:timeseriesoverlays} A plot showing your variables on a common time axis is a useful exploratory graph. Values from different series are scaled to have the same relative range so the covariation in the variables can be visually compared. Here you do this with hurricane counts and sea-surface temperature (SST). Begin by loading {\it annual.RData}. These data were assembled in Chapter~\ref{chap:datasets}. Subset the data for years starting with 1900 and rename the year column. <>= load("annual.RData") dat = subset(annual, Year >= 1900) colnames(dat)[1] = "Yr" @ Plot the basin-wide hurricane count by year, then plot SST data from the North Atlantic. You do this by keeping the current graphics device open with the \verb@new=TRUE@ switch in the \verb@par@ function. <