Time Series Forecasting Techniques

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

lOMoARcPSD|14875627

Time Series & forecasting techniques

Time series (International University - VNU-HCM)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)
lOMoARcPSD|14875627

TIME SERIES & FORECASTING


HOMEWORK 2
Question 1: (20 points)
The number of marriages in the United States is given in below table:

Year Marriages (1,000s) Year Marriages (1,000s)


1985 2,413 1995 2,336
1986 2,407 1996 2,344
1987 2,403 1997 2,384
1988 2,396 1998 2,244
1989 2,403 1999 2,358
1990 2,443 2000 2,329
1991 2,371 2001 2,345
1992 2,362 2002 2,254
1993 2,334 2003 2,245
1994 2,362 2004 2,279
a. Compute the first differences for these data.
b. Plot the original data and the difference data as a time series.
c. From your observation of above plots, is there a trend in either of these series?
● Answer:
a. Compute the first differences for these data.
Year, Marriages (1,000s), First differences, Year, Marriages (1,000s), First differences,
t Y[t] Y[t] - Y[t-1] t Y[t] Y[t] - Y[t-1]
1985 2,413 1995 2,336 -26
1986 2,407 -6 1996 2,344 8
1987 2,403 -4 1997 2,384 40
1988 2,396 -7 1998 2,244 -140
1989 2,403 7 1999 2,358 114
1990 2,443 40 2000 2,329 -29
1991 2,371 -72 2001 2,345 16
1992 2,362 -9 2002 2,254 -91
1993 2,334 -28 2003 2,245 -9
1994 2,362 28 2004 2,279 34

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

b. Plot the line charts of original data and the difference data as a time series (2
separate graphs).
 Figure 1: Original Time Series

 Figure 2: Difference Time Series

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

c. From your observation of above plots, is there a trend in either of these series?
 Figure 1: Original Time Series
From figure 1, it is clear that there is a steady drop over the years. Hence, there is a trend
in the original time series.

 Figure 2: Difference Time Series


From figure 2, it is clear that there is no trend in the difference series over the time
because of unexpected increase or descrease of this time series.

Question 2: (20 points)


Compute the 95% confidence interval for the autocorrelation coefficient for time lag 1 for a
series that contains 80 terms, following these steps:
a. Find sample size, n
b. Find the critical value for two-tailed test of 95% confidence interval by Z-table
c. Calculate the confidence interval for the autocorrelation coefficient for time lag 1 by
below formula:

● Answer:
a. We are given the sample size is n = 80
α
b. Confidence interval: 1−α=0.95=¿ α=0.05=¿ =0.25
2
Critical value: Zα =1.96
=0.025
2

c. 0±Zα
2
( √1n )=± 1.96 ( √180 )=±0.219=¿(−0.219; 0.219)
Question 3: (20 points)
Allie White, the chief loan officer for the Dominion Bank, would like to analyze the bank’s loan
portfolio for the years 2001 to 2006. The data are shown in the below table:

Calendar Mar. 31 Jun. 30 Sep. 30 Dec. 31


2001 2,313 2,495 2,609 2,792
2002 2,860 3,099 3,202 3,161
2003 3,399 3,471 3,545 3,851
2004 4,458 4,850 5,093 5,318
2005 5,756 6,013 6,158 6,289
2006 6,369 6,568 6,646 6,861
Table - Quarterly Loans ($ millions) for Dominion Bank, 2001–2006

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

a. Compute the autocorrelations for time lags 1 and 2 by below formulas.

;
107176
Ý = =4465.67
24

50056714.36
r 1= =0.895
55912891.3

44081584.29
r 2= =0.788
55912891.3

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

b. Test to determine whether these autocorrelation coefficients are significantly different


from zero at the .05 significance level. Use the two-tailed t-test and refer to the below
formula (with df = n-1).

;
Hypothesis testing for r1:
H0: p1=0
H1: p1 ≠ 0
Test statistic:
r 1−0 0.895
t= = =4.39

√ √
1−1 1+2(0)
1+2 ∑ r 21 24
i =1
n
Reject if t > t23,0.025 or t < -t23,0.025
t23,0.025= 2.069
Since t > t23,0.025 (4.39>2.069)
→ We reject H0. There is statistical evidence that r1 is different form 0
Hypothesis testing for r2:
H0: p2=0
H1: p2 ≠ 0
Test statistic:
0.788
¿
¿
¿2
¿
1+2¿
¿
√¿
r 2−0 0.788
t= = ¿


2−1
1+2 ∑ r 22
i =1
n
Reject if t > t23,0.025 or t < -t23,0.025
t23,0.025= 2.069
Since t > t23,0.025 (2.578 > 2.069)

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

→ We reject H0. There is statistical evidence that r2 is different form 0

c. Find the plot of data in below figure. From your observation of this plot, is there any
trend in this time series? (Increasing trend/Decreasing trend/No trend)

This time series has a trend because of increasing data.

d. Find the plot of the autocorrelations for the first six-time lags in below figure. From your
observation of this plot, is this time series stationary? Discuss why.

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

The autocorrelation coefficient for the first few lag is different from 0. And it drops gradually
from 0.9 to 0.3 after 6 period. Hence, the series has a trend and non-stationary.

Question 4: (20 points)


Analyze the autocorrelation coefficients for the series shown in Figures 18 through 21. Briefly
describe each series.

---

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

---

---

● Answer:
 Figure 18:

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

For trade, the autocorrelation coefficient for the first few lag is different from 0, specifically
0.9 in the 1st period, 0.8 in the 2nd and 0.7 in the 3rd. Then it drops gradually and stays at 0.2 in
the 15th period. Hence, the series has a trend.
 Figure 19:
For acid, the autocorrelation coefficients are close to 0 for any lag. The successive values of a
time series are not related to each other. Therefore, the time series is random data.
 Figure 20:
For trade first differenced, the autocorrelation coefficients repeated 4 for quarterly. Besides,
after repeating seasonal lags for 2 times, there would be a autocorrelation coefficients
touched the bound.
 Figure 21:
For fuel, the autocorrelation coefficient at the 1st period is significant difference from 0 but
after its close to 0. Therefore, the time series does not have a trend.

Question 5: (… points)
Calculate the Mean Absolute Error (MAE), Mean Percentage Error (MPE), Mean Absolute
Percentage Error (MAPE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE) of
below data set by filling below table.
(Note: Round your calculation to 4 decimals)
● Answer:
Period, Actual, Forecast,
|A[t] - F[t]| (A[t] - F[t])/A[t] |(A[t] - F[t]|/A[t] (A[t] - F[t])^2
t A[t] F[t]
1 94 73 21 0.2234 0.2234 441
2 70 71 1 -0.0143 0.0143 1
3 78 85 7 -0.0897 0.0897 49
4 75 76 1 -0.0133 0.0133 1
5 89 71 18 0.2022 0.2022 324
6 89 95 6 -0.0674 0.0674 36
7 85 98 13 -0.1529 0.1529 169
8 80 87 7 -0.0875 0.0875 49
9 75 86 11 -0.1467 0.1467 121
10 72 75 3 -0.0417 0.0417 9
11 86 87 1 -0.0116 0.0116 1
12 82 83 1 -0.0122 0.0122 1
13 99 78 21 0.2121 0.2121 441
14 77 90 13 -0.1688 0.1688 169
15 86 91 5 -0.0581 0.0581 25
16 82 92 10 -0.1220 0.1220 100
17 81 75 6 0.0741 0.0741 36
18 89 94 5 -0.0562 0.0562 25

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)


lOMoARcPSD|14875627

19 79 80 1 -0.0127 0.0127 1
20 96 71 25 0.2604 0.2604 625
21 79 70 9 0.1139 0.1139 81
22 74 85 11 -0.1486 0.1486 121
23 82 89 7 -0.0854 0.0854 49
24 77 86 9 -0.1169 0.1169 81

MAE = MPE = MAPE = MSE = RMSE =


8.8333 -0.0133 0.1038 123.1667 11.098

10

Downloaded by Qu?nh Ph??ng (quynhntp13@gmail.com)

You might also like