Statistics lecture 13 (chapter 13)
Upcoming SlideShare
Loading in...5
×
 

Statistics lecture 13 (chapter 13)

on

  • 1,320 views

Time Series Analysis

Time Series Analysis

Statistics

Views

Total Views
1,320
Views on SlideShare
1,320
Embed Views
0

Actions

Likes
1
Downloads
93
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Statistics lecture 13 (chapter 13) Statistics lecture 13 (chapter 13) Presentation Transcript

    • 1
    • • Sequence of observations of the same variable taken at equally spaced points in time.• Each observation records both the value of the variable and the time it was made.• Tell us where we are and suggest where we are going.• Time series data are used to predict future values for forecasting. 2
    • Time plots• Can reveal the main features of a time series.• Look for the overall pattern and for deviations from the pattern.• Time on x-axis, measured variable on y-axis.• Plot the points and connect them with straight lines. 3
    • Time plots – Example SA Fuel Price 800 700 600 Rand 500 400 300 200 100 0 J F M A M J J A S O N D J F M A M J J A S Months 2008 - 2009 4
    • Components of a time series• Trend – (T)• Seasonal variations – (S)• Cyclical Variations – (C)• Irregular (random) variations – (I) 5
    • Components of a time series• Trend – (T) – Overall smooth pattern and show long-term upward or downward movement. – Trend analysis isolate the long-term movement and is used to make long-term forecasting. 6
    • Components of a time series• Seasonal variation – (S) – Rises and falls occurring in particular times of the year and repeated every year. • Period of times may be years, months, days, hours or quarters. – Seasonal effect can be taken into account to evaluate activity and can be incorporated into forecasts of future activity. 7
    • Components of a time series• Cyclical variation – (C) – Patterns that repeat over time periods that exceed one year. – Time period for the cycle usually differ form each other. • Business cycles – recession, depression, recovery or boom. • Changes in governmental monetary and fiscal policy, etc. 8
    • Components of a time series• Irregular variation – (I) – Variation left after the trend, seasonal and cyclical variations have been removed. – Have an irregular, saw-tooth pattern. – Cannot be predicted. – Unusual events. • Political events, war, riots, strikes, etc. – Cannot be analysed statistically or forecasted. 9
    • CONCEPT QUESTIONS• Questions 1-5 ,p462, textbook 10
    • Decomposition of a time series• Multiplicative time series model: – Original observed value Yt – Yt = TSCI• Decomposing a time series into four components.• Isolate the influence of each of the four components.• Statistical methods can isolate trend and seasonal variations.• To isolate cyclical and irregular variation is of less value. 11
    • Decomposition – Trend analysis• Shows the general direction in which the series is moving. – Regression analysis – linear trend line – Moving average method – smooth curve 12
    • Decomposition – Trend analysis – Linear trend• ŷt = a + bx – ŷt = estimated time series values – x = time• List the values of x and yt – Code x • 1st time period – x =1 • 2nd time period – x =2 ………. • nth time period – x = n – yt = original time series values 13
    • Decomposition – Trend analysis – Linear trend• Determine the values of a and b:  2 x  1 n(n  1)  6 x 2  1 n(n  1)(2n  1) yt  1 n  yt x 1 nx S XX   x   x   xy    x   y  2 1 2 1 n S XY t n t S XY b S XX a  yt  bx 14
    • Decomposition – Trend analysis – Linear trend• ŷt = a + bx• Substitute each value of xi into the trend equation to find the trend component.• Draw the trend line on the same graph as the original time series.• The trend line can now be used to estimate future values of the dependent variable (ŷt). 15
    • Decomposition – Linear trend – Example• The table below lists the quarterly number of foreign visitors at a game ranch in Limpopo for the past 3 years. 2006 2007 2008 I II III IV I II III IV I II III IV 23 59 64 32 26 45 69 29 15 36 47 38 16
    • Decomposition – Linear trend – Example Visitors at a game ranch 80 Number of visitors 70 60 50 40 30 20 10 0 I II III IV I II III IV I II III IV Quarters 2006 - 2008 17
    • Decomposition – Linear trend – Example • Determine the values of a and b 2006 2007 2008 I II III IV I II III IV I II III IVyt 23 59 64 32 26 45 69 29 15 36 47 38x 1 2 3 4 5 6 7 8 9 10 11 12  x  n(n  1)  12(12  1)  78 1 2 1 2  x  n(n  1)(2n  1)  12(12  1)(2(12)  1)  650 2 1 6 1 6  y  483 t  xy  3044t yt  12 (483)  40, 25 1 x  12 (78)  6,5 1 18
    • Decomposition – Linear trend – Example• Determine the values of a and b:S XX   x   x   650  12 (78) 2  143 2 1 2 1 nS XY   xyt  1   x   yt   650  12 (78)(483)  95,5 n 1 S XY 95,5b   0, 668 S XX 143a  yt  bx  40.25  (0, 668)(6,5)  44,592 yt  44,592  0,668 x ˆ 19
    • Decomposition – Linear trend – Example• Determine the values of the isolated trend component If x = 1 then yt  44,592  0,668(1)  43,924 ˆ If x = 2 then yt  44,592  0,668(2)  43, 256 ˆ 20
    • Decomposition – Linear trend – Example • Plot the trend line on the graph Visitors at a game ranch 80Number of visitors 70 60 yt  44,592  0,668x ˆ 50 40 30 20 10 0 I II III IV I II III IV I II III IV Quarters 2006 - 2008 21
    • Decomposition – Linear trend – Example• Forecast the values for the next four quarters• Determine the x-values for the next four quarters.• Determine the estimated number of visitors for the next four quarters. If x = 13 then yt  44,592  0,668(13)  35,908 ˆ If x = 14 then yt  44,592  0,668(14)  35, 24 ˆ 22
    • IMPORTANT• Forecasting in this way assumes the same linear trend holds true for future time periods• Remember:- 23
    • ALSO IMPORTANT• Without seeing the trend line graphically it is still possible to determine whether the trend is increasing or decreasing over time• Slope of line is given by b. If b is +ve the slope is +ve and the trend is increasing over time. If b is –ve the slope is –ve and the trend is decreasing over time• The strength of the trend influence can be assessed by looking at b. A string upward/downward trend is shown by large +ve/-ve values of b. Values of b close to 0 indicate a wek trend 24
    • EXAMPLEThe table below shows the annual expenditure of Exel Ltdon salaries (in R100,000), for each semester for a 4 yearperiod. Year Semester1 Semester 2 2002 140.3 160.6 2003 139.6 158.2 2004 141.4 163.8 2005 143.5 167.3A. What is the value of the slope of the linear trend line for this time series?B. What is the value of the intercept (line crosses Y axis) of the linear trend line for this time series?C. Forecast the expenditure on salaries (in rands) for the second semester in 2006 25
    • EXAMPLE ANSWER A.  x = 36  x = 204 2 x = 4,5  y = 1 214,7 y = 151,8375  xy = 5 545,8 SXX = 42 SXY = 79,65 S b = XY SXX 79,65 = 42  = 1,8964 B.  a = y – b x = 151,8375 – 1,8964(4,5) = 143,3037  C.  ˆ y = 143,3037 + 1,8964(10) 26 = 162,2677
    • Decomposition – Trend analysis – Moving average• Removes the short term fluctuations in a time series. – Smoothing a time series• Remove the effect of seasonal and irregular variations.• Reflect the trend and cyclical movements. – TC 27
    • Decomposition – Trend analysis – Moving average • How to calculate a k-point moving average if k is odd 3-point moving 5-point movingTime (X) Price (yt) average average2008 - O 564.03 564.03  519.03  358.03 N 519.03 480.37 3 D 358.03 381.02 406.81  480.372009 - J 265.98 317.00 368.40 F 326.98 321.65 338.09 519.03  358.03  265.98 M 371.98 355.48 339.38 3 A 367.48 367.98 362.06  381.02 M 364.48 370.45 379.94 J 379.38 386.75 383.54 J 416.38 395.25 395.23 A 389.98 410.76 28 S 425.93
    • Decomposition – Trend analysis – Moving average • How to calculate a k-point moving average if k is odd 3-point moving 5-point movingTime (X) Price (yt) average average2008 - O 564.03 N 519.03 480.37 D 358.03 381.02 406.812009 - J 265.98 317.00 368.40 F 326.98 321.65 338.09 M 371.98 355.48 339.38 A 367.48 367.98 362.06 M 364.48 370.45 379.94 J 379.38 386.75 383.54 J 416.38 395.25 395.23 A 389.98 410.76 29 S 425.93
    • EXAMPLE Calculate a 3 point moving average and a 5 point moving average for the 2011 salaries of Rinto Ltd. The monthly salary data (in R10,000’s) is as follows:-Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov DecSal (y) 8 4 6 10 8 10 13 5 11 14 10 11 30
    • Example answer• Example 13.3, p470, textbook 31
    • Decomposition – Trend analysis – Moving average• How to calculate a k-point moving average if k is even. 32
    • Decomposition – Trend analysis – Moving average• Plot the original time series data and moving average. Visitors at a game ranch 80 Number of visitors 70 60 yt 50 40 30 centred 20 moving 10 average 0 I II III IV I II III IV I II III IV Quarters 2006 - 2008 33
    • EXAMPLE Calculate a 4 point moving average average for the 2011 salaries of Rinto Ltd. The monthly salary data (in R10,000’s) is as follows:-Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov DecSal (y) 8 4 6 10 8 10 13 5 11 14 10 11 34
    • Example answer• Example 13.4, p471, textbook 35
    • TERM OF MOVING AVERAGEGiven a set of time series data how do wechose an appropriate moving averageterm (k) for the series?Months 12Quarters 4Workdays 5 36
    • Decomposition – Seasonal analysis• Isolates the seasonal components in a time series.• Dominates short-term movement.• Find seasonal index for each period. – Specific seasonal index • specific year • short term – Typical seasonal index • number of years • long term 37
    • MOVING AVERAGES• Dampens short term fluctuations• Shorter terms still show some variations; longer terms produce a much smoother curve• Disadvantages of moving averages:-• Loss of information on both sides of the series• Not a specific mathematical equation therefore cannot be used in isolation to make objective forecasts 38
    • SEASONAL ANALYSIS• Isolates the seasonal component in a time series• Most business and economic time series contain seasonal variations• To isolate the seasonal component we must find a seasonal index for each time period• Seasonal indices important because they are used to forecast future values 39
    • SEASONAL INDICES• Two types:- – Specific seasonal index – measures seasonal change during a specific year – Typical seasonal index – measures seasonal changes over a number of years 40
    • Decomposition – Seasonal analysis– Ratio-to-moving-average method• Use moving average to smooth time series: – Isolates trend and cyclical variations – Yt = TC – Y  TSCI 100  SI 100 - seasonal and irregular t TC• Find a typical seasonal index for each period.• Remember that sum of k mean seasonal indices must = k x 100.Calculate a series of seasonally adjusted values: – Y  TSCI 100  TCI 100 t S• Construct a trend line for the seasonally adjusted data.• Construct forecasts of the time series values. 41
    • Decomposition– Seasonal analysis– Ratio-to-moving-averagemethod 42
    • TSCI  SI TC 64  100  142.62 44.88TSCI  SI TC 36  100  109.51 32.88 43
    • Yt = Yt = TCITCSI/TC=SI 42.81 Calculate the mean 53.52 index for each quarter: 142.62 40.10 73.56 20.05 I II III IV 61.36 48.39 2006 142.62 73.56 105.57 40.82 2007 61.36 105.57 168.81 75.57 168.81 43.23 2008 43.48 109.51 Total 75.57 37.94 Mean 52.42 107.54 155.715 74.565 390.24 43.48 27.92 Typical SI 53.73 110.23 159.61 76.43 400 109.51 32.66 29.45 49.72 44
    • Yt = Yt = TCITCSI/TC=SI Sum of mean indices = 390,24 42.81 53.52 Must be adjusted to 400 142.62 40.10 73.56 20.05 I II III IV 61.36 48.39 2006 142.62 73.56 105.57 40.82 2007 61.36 105.57 168.81 75.57 168.81 43.23 2008 43.48 109.51 Total 75.57 37.94 Mean 52.42 107.54 155.715 74.565 390.24 43.48 27.92 Typical SI 53.73 110.23 159.61 76.43 400 109.51 32.66 k 100 400 adjustment factor =   1, 025 29.45  mean SI 390, 24 49.72  52, 42 1, 025  53, 73 45
    • Time yt = Yt = Yt = TCI I II III IV (x) TCSI TCSI/TC=SI 2006 142.62 73.562006 - I 1 23 42.81 II 2 59 53.52 2007 61.36 105.57 168.81 75.57 III 3 64 142.62 40.10 2008 43.48 109.51 Total IV 4 32 73.56 20.05 Mean 52.42 107.54 155.715 74.565 390.242007 - I 5 26 61.36 48.39 Typical SI 53.73 110.23 159.61 76.43 400 II 6 45 105.57 40.82 III 7 69 168.81 43.23 Seasonal adjusted value = TCI IV 8 29 75.57 37.94 232008 - I 9 15 43.48 27.92 100  42,81 53, 73 II 10 36 109.51 32.66 III 11 47 29.45 IV 12 38 49.72 46
    • Time yt = Yt = Yt = TCI I II III IV (x) TCSI TCSI/TC=SI 2006 142.62 73.562006 - I 1 23 42.81 II 2 59 53.52 2007 61.36 105.57 168.81 75.57 III 3 64 142.62 40.10 2008 43.48 109.51 Total IV 4 32 73.56 20.05 Mean 52.42 107.54 155.715 74.565 390.242007 - I 5 26 61.36 48.39 Typical SI 53.73 110.23 159.61 76.43 400 II 6 45 105.57 40.82 III 7 69 168.81 43.23 Seasonal adjusted value = TCI IV 8 29 75.57 37.94 292008 - I 9 15 43.48 27.92 100  37,94 76, 43 II 10 36 109.51 32.66 III 11 47 29.45 IV 12 38 49.72 47
    • Decomposition – Seasonal analysis• Determine the trend line:  2 x  1 n(n  1)  1 12(12  1)  78 2  6 x 2  1 n(n  1)(2n  1)  1 12(12  1)(2(12)  1)  650 6  y  466, 61 t  xy  2941, 78 t yt  12 (466, 61)  38,88 1 x  12 (78)  6,5 1 48
    • Decomposition – Seasonal analysis Seasonally• Determine the trend line: adj dataS XX   x    x   650  (78)  143 2 1 2 1 2 n 12S XY   xyt  1 n   x   y   2941, 78  (78)(466, 61)  91,185 t 1 12 S XY 91,185b   0, 638 S XX 143a  yt  bx  38,88  (0, 638)(6,5)  43, 027yt  43,027  0,638 xˆ 49
    • Decomposition – Seasonal analysis• Determine the values of the isolated trend component: If x = 9 then yt  43, 027  0, 638(9)  37, 29 ˆ If x = 14 then yt  43, 027  0, 638(14)  34,10 ˆ 50
    • Decomposition – Seasonal analysis• Determine the real predicted values: 34, 73  53, 73 33, 46 159, 61  18, 7  53, 401 100 100 51
    • Decomposition – Seasonal analysis• Represent the real predicted values graphically: Visitors at a game ranch 60.00 Number of visitors 50.00 40.00 30.00 20.00 10.00 0.00 I II III IV I II III IV I II III IV I II III IV Quarters 2006 - 2009 52
    • EXAMPLEMONTH PRICE Jan 355 Feb 326 Mar 371 Apr 375 May 389 Jun 365 Jul 362 Aug 351 Sep 346 Oct 364 Nov 399 Dec 338 53
    • Example AnswerSee answer sheet 54