You are on page 1of 3

Comparison of acfs

Comparison of artificial acfs

Consider the artificial series x1 and x2:

x1 <- c(39, 35, 16, 18, 7, 22, 13, 18, 20, 9, -12, -11, -19, -9, -2, 16)
x2 <- c(47, -26, 42, -10, 27, -8, 16, 6, -1, 25, 11, 1, 25, 7, -5, 3)

For each series:

• Plot the series.

par(mfrow = c(2,1), mar = c(5,4,1,0))


ts.plot(x1)
ts.plot(x2)
20 40
x1

−20 0

5 10 15

Time
20
x2

−20

5 10 15

Time

• Make a scatter plot of the series and its lag 1 values.

i <- 1:(length(x1)-1)
par(mfrow = c(2,1), mar = c(5,4,1,0))
plot(x1[i], x1[i+1])
plot(x2[i], x2[i+1])

1
20
x1[i + 1]

0
−20

−20 −10 0 10 20 30 40

x1[i]
40
x2[i + 1]

10
−20

−20 0 20 40

x2[i]

• Plot the acf and comment.

par(mfrow = c(2,1), mar = c(5,4,1,0))


acf(x1)
acf(x2)

2
0.5
ACF

−0.5

0 2 4 6 8 10 12

Lag x2
Series
0.5
ACF

−0.5

0 2 4 6 8 10 12

Lag

You might also like