#Demos for the course in Fall 2010 #Week 1 # Time series objects, time series plots # Functions: p.ts, ts.union, ts.intersect, lag help(ts) str(lynx)#shows the structure of the data set lynx plot(lynx) lx <- as.vector(lynx) plot(lx) plot(lynx,log="y") AirPassengers plot(AirPassengers) plot(AirPassengers,log="y") plot(sunspot.year) plot(treering) p.ts(treering, nr=3) #requires package "sfsmisc" #Multivariate time series sales1 <- ts.union(BJsales, lead = BJsales.lead) plot(sales1) sales2 <- ts.union(BJsales, lead = 20*BJsales.lead) plot(sales2,plot.type="single",col=1:2) sales3 <- ts.intersect(sales2, lead3 = lag(20*BJsales.lead, -3)) plot(sales3,plot.type="single",col=1:3) plot(EuStockMarkets) p.ts(EuStockMarkets, col = 2:5)