Chapter 1 Part 1 Solutions

Chapter 1 – Part I solutions 1.1 Stationarity requires regularity in the mean and autocorrelation functions, so that the

Views 136 Downloads 1 File size 162KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Chapter 1 – Part I solutions 1.1 Stationarity requires regularity in the mean and autocorrelation functions, so that these quantities (at least) may be estimated by averaging. 1.2 Code for (a)-(c) w = rnorm(150,0,1) # 50 extra to avoid startup problems xa = filter(w, filter=c(0,-.9), method="recursive")[-(1:50)] # AR xb = 2*cos(2*pi*(1:100)/4) + rnorm(100,0,1) # sinusoid + noise xc = log(jj) va = filter(xa, rep(1,4)/4) # moving average vb = filter(xb, rep(1,4)/4) # moving average vc = filter(xc, rep(1,4)/4) # moving average par(mfrow=c(3,1), mar=c(3,3,2,1)) plot.ts(xa, main="autoregression") lines(va, col=2) plot.ts(xb, main="sinusoid + noise") lines(vb, col=2) plot.ts(xc, main="Johnson & Johnson") lines(vc, col=2)

(d) Seasonal adjustment is a filter to remove obvious seasonal periodicities (e.g., quarterly or annual fluctuations) so that other interesting dynamics may be observed. (e) All 3 time series generated had a primary period of 4 (1 cycle every 4 time points). The filter that averages 4 contiguous time points removes the periodic behavior and accentuates the “trend” (no trend in the first two, linear trend in the third series).

1.6

1.7