Sei sulla pagina 1di 2

Time Series Laboratory Exercise I

ASAAD, Al-Ahmadgaid B. June 29, 2012


I. Look for a data that will follow a rst order autoregressive model, AR(1). Source of the Data: Cowpertwait, P. S.P. and Metcalfe, A. V., "Introductory Time Series with R (Use R)", 2009. website: http://www.massey.ac.nz/~pscowper/ts/ Data: http://www.massey.ac.nz/~pscowper/ts/pounds_nz.dat And here are the rst ve observations taken from the data.
xrate 2.9243 2.9422 3.1719 3.2542 3.3479

R Computation
To obtain a nice time series plot, it is better to add another variable "time". And heres the addition to the above rst ve data.
xrate 2.9243 2.9422 3.1719 3.2542 3.3479 time 1991-03-01 00:00:00 1991-06-01 00:00:00 1991-09-01 00:00:00 1991-12-01 00:00:00 1992-03-01 00:00:00

Time Series Plot


library(ggplot2) Data <- read.csv("TimeSData.csv", header = TRUE) DataWT <- as.Date(Data$time)

qplot(DataWT, Data$xrate, data=Data) + geom_line(size=1, colour="red") + xlab(expression(bold("Time: Four Quarter a Year"))) + ylab(expression(bold("Exchange Rate"))) + opts(title=expression(bold("Exchange Rate

time series laboratory exercise i

(New Zealand Dollar per UK Pound)")), plot.title=theme_text(size = 12, colour = "darkblue"))

The ACF plot

Potrebbero piacerti anche