TIME SERIES Frequently, the data consist of numbers recorded by time period. For example, sales by year, units of output by week, expenses by month and so on. A series of values of a variable recorded for succeeding (berturut turut) time period is called a time series. For example: Year Sales (hundreds)
1999 930
2000 1028
2001 1267
2002 1035
2003 1057
2004 1332
2005 1567
2006 1757
2007 1616
Time series are analyzed to obtain measures that can be used for making current decision, forecasting, and for planning future operations. A time series has four components : long term trend (T), cycles(C), seasonal (S), irregular(I). A line describing a time series movements that persists(berlangsung) for many years is called a long term trend. Movements of the average level of a time series above and bellow the long term trend are called cyclical movements. A seasonal pattern is a within-a-year pattern whose shape repeats year after year. Irregularities are random variations in a time series. Trend Linear Trend: Trend equation is : Y’= a + b X, Semi average Method Steps 1. Divide the time series in two groups 2. Compute average of group I ( Y 1) and group II ( Y 2) 3. Trend equation is : Y’= a + b X , where Y= trend value, a= Y 1, b=( Y 2- Y 1)/n, n=(middle time of group II - middle time of group I), X = year - middle time of group I (as a base period/base year/tahun dasar). If amount of years is odd, the mid year must not include either in group I or group II. X=0 represents the mid year of Group I
1
Least Square Method 1. Linear Trend Y’= a + b X Where: b=
n Σ XY -(ΣX) (ΣY) ________________ nΣ X2 -(Σ X )2
a = (Σ Y)/n - b (Σ X)/n To simplify the formula, we code the year to make Σ X=0
b=
Σ XY ______ Σ X2
a = (Σ Y)/n Example-1 The following time series data describes sales ( in thousands unit) of a company from 1990 to 1999. Year Unit
1990 23
1991 28
1992 34
1993 35
1994 40
1995 41
1996 48
1997 50
1998 58
Find Linear Trend Equation: Year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 Total
Y 23 28 34 35 40 41 48 50 58 60 417
X -9 -7 -5 -3 -1 1 3 5 7 9 0
Xy -207 -196 -170 -105 -40 41 144 250 406 540 663
x2 81 49 25 9 1 1 9 25 49 81 330
b= 663/330 = 2.01 a= 417/10= 41.7 Linear Trend Equation: Y’= 41.7 + 2.01 X It means average sales at base is 41,700 and it increase by 2,010 per semester.
2
1999 60
2. Quadratic Trend Y’= a + b1 X + b2 X2 We use the following linear equation systems to find a and b2 (1) Σ Y = n a + b2 ΣX2 (2) Σ X2Y = a ΣX2+ b2 ΣX4 And We use the following formula to find b1 Σ XY ______ b1 = Σ X2 Example-2 The following time series data describes amount of loan ( in billions rupiah) of a bank from 1990 to 2000. Year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 Loan 600 714 778 856 915 990 1025 1070 1100 1130 1140 Find Quadratic Trend Equation: Year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 Total
Y 600 714 778 856 915 990 1025 1070 1100 1130 1140 10318
X -5 -4 -3 -2 -1 0 1 2 3 4 5 0
XY -3000 -2856 -2334 -1712 -915 0 1025 2140 3300 4520 5700 5868
X2 25 16 9 4 1 0 1 4 9 16 25 110
X2Y 15000 11424 7002 3424 915 0 1025 4280 9900 18080 28500 99550
Find a and b2 10318 = 99550 =
11 a + 110 a +
110 b2 1958 b2
103180 = 99550 =
110 a + 110 a +
1100 b2 1958 b2
3630 =
0 a+
-858 b2
b2
=
a
=
b1
=
3630 = -858 980,31
-4,231
5868 = 110
53,345
x
10
Quadratic Trend Equation: Y’= 980,31+ 53,345 X -4,23 X2
3
X4 625 256 81 16 1 0 1 16 81 256 625 1958
3. Exponential Trend Y’= a b X To find a and b, the first step is to convert Y’= a b X into linear model. Y’= a b X Log Y’= Log a b X Log Y’= Log a + Log b X Log Y’= Log a + X Log b Y” = a’ + b’ X (linear model) Where,
a’ =
b’ =
ΣY” ΣLogY ______ = ______ n n Σ XY” ______ = ΣX2
Σ XLogY ______ ΣX2
Example-3 The following time series data describes production from 1990 to 2000. Year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 405 420 441 465 490 522 552 585 620 670 725 Production Find Exponential Trend Equation: Year 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2004 Total
y 405 420 441 465 490 522 552 585 620 670 725 5895
x -5 -4 -3 -2 -1 0 1 2 3 4 5 0
a’=
29.93836 11 2.721669
a=
102,721669=526.83
a’=
Log y 2,607455 2,623249 2,644439 2,667453 2,690196 2,717671 2,741939 2,767156 2,792392 2,826075 2,860338 29,93836
x logy -13,03728 -10,493 -7,933316 -5,334906 -2,690196 0 2,741939 5,534312 8,377175 11,3043 14,30169 2,770725
4
x2 25 16 9 4 1 0 1 4 9 16 25 110
b’=
2.770725 110 0.025188
b=
100.025188=1.06
b’=
Exponential Trend Equation: Y’= 526.83 (1.06) X 4. Comparing Trend Fits Statisticians use the sum of the squares of the Y-Y’ differences, Σ (Y-Y’)2 to measure how well different trend fit a time series. For a given time series, a linear, a parabolic(quadratic) and a exponential trend will not lead to the same Σ (Y-Y’)2 . The best-fitting trend is the one that has the smallest Σ (Y-Y’)2. Year Y
2000 6,2
2001 6,4
2002 6,9
2003 7,7
2004 8,8
2005 10,4
The linear, parabolic(quadratic) and exponential trend for the time series are: Linear Trend Y= 7,733333 +
0,414286 X
Quadratic Trend Y=
7,24375 +
0,414286 X
+
0,041964 X
2
Exponential Trend Y=
7,601592
Year 2000 2001 2002 2003 2004 2005 Sum
Y 6,2 6,4 6,9 7,7 8,8 10,4
1,053546
X
Linear (Y-Y')2 Y' 5,661905 0,289546 6,490476 0,008186 7,319048 0,175601 8,147619 0,200363 8,97619 0,031043 9,804762 0,354308 1,059048
The best-fitting trend is quadratic trend.
5
Quadratic (Y-Y')2 Y' 6,221429 0,000459 6,378571 0,000459 6,871429 0,000816 7,7 7,89E-31 8,864286 0,004133 10,36429 0,001276 0,007143
Exponential (Y-Y')2 Y' 5,856473 0,118011 6,500452 0,010091 7,215242 0,099377 8,008631 0,095253 8,889261 0,007967 9,866725 0,284383 0,615082