1 / 60

Time series Decomposition

Time series Decomposition. Farideh Dehkordi-Vakil. Introduction. One approach to the analysis of time series data is based on smoothing past data in order to separate the underlying pattern in the data series from randomness.

dawn-glover
Download Presentation

Time series Decomposition

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Time series Decomposition Farideh Dehkordi-Vakil

  2. Introduction • One approach to the analysis of time series data is based on smoothing past data in order to separate the underlying pattern in the data series from randomness. • The underlying pattern then can be projected into the future and used as the forecast.

  3. Introduction • The underlying pattern can also be broken down into sub patterns to identify the component factors that influence each of the values in a series. • This procedure is called decomposition. • Decomposition methods usually try to identify two separate components of the basic underlying pattern that tend to characterize economics and business series. • Trend Cycle • Seasonal Factors

  4. Introduction • The trend Cycle represents long term changes in the level of series. • The Seasonal factor is the periodic fluctuations of constant length that is usually caused by known factors such as rainfall, month of the year, temperature, timing of the Holidays, etc. • The decomposition model assumes that the data has the following form: Data = Pattern + Error = f (trend-cycle, Seasonality , error)

  5. Decomposition Model • Mathematical representation of the decomposition approach is: • Yt is the time series value (actual data) at period t. • St is the seasonal component ( index) at period t. • Tt is the trend cycle component at period t. • Et is the irregular (remainder) component at period t.

  6. Decomposition Model • The exact functional form depends on the decomposition model actually used. Two common approaches are: • Additive Model • Multiplicative Model

  7. Decomposition Model • An additive model is appropriate if the magnitude of the seasonal fluctuation does not vary with the level of the series. • Time plot of U.S. retail Sales of general merchandise stores for each month from Jan. 1992 to May 2002.

  8. Decomposition Model • Multiplicative model is more prevalent with economic series since most seasonal economic series have seasonal variation which increases with the level of the series. • Time plot of number of DVD players sold for each month from April 1997 to June 2002.

  9. Decomposition Model • Transformations can be used to model additively, when the original data are not additive. • We can fit a multiplicative relationship by fitting an additive relationship to the logarithm of the data, since if • Then

  10. Seasonal Adjustment • A useful by-product of decomposition is that it provides an easy way to calculate seasonally adjusted data. • For additive decomposition, the seasonally adjusted data are computed by subtracting the seasonal component.

  11. Seasonal Adjustment • For Multiplicative decomposition, the seasonally adjusted data are computed by dividing the original observation by the seasonal component. • Most published economic series are seasonally adjusted because Seasonal variation is usually not of primary interest

  12. Deseasonalizing the data • The process of deseasonalizing the data has useful results: • The seasonalized data allow us to see better the underlying pattern in the data. • It provides us with measures of the extent of seasonality in the form of seasonal indexes. • It provides us with a tool in projecting what one quarter’s (or month’s) observation may portend for the entire year.

  13. Deseasonalizing the data • Fore example, assume you are working for a manufacturer of major household appliances and heard that housing starts for the first quarter were 258.4. Since your sales depend heavily new construction, you want to project this forward for the year. We know that housing starts show strong seasonal components.To make a more accurate projection you need to take this into consideration. Suppose that the seasonal index for the first quarter of the housing start is .797.

  14. Deseasonalizing the data and Finding Seasonal Indexes • Once the Seasonal indexes are known you can deseasonalize data by dividing by the appropriate index that is: Deseasonalized data = Raw data/Seasonal Index • Therefore • Multiplying this deseasonalized value by 4 would give a projection for the year of 1,296.864.

  15. Deseasonalizing the data and Finding Seasonal Indexes • In general: • Seasonal adjustment allows reliable comparison of values at different points in time. • It is easier to understand the relationship among economic or business variables once the complicating factor of seasonality has been removed from the data. • Seasonal adjustment may be a useful element in the production of short term forecasts of future values of a time series.

  16. Trend-Cycle Estimation • The trend-cycle can be estimated by smoothing the series to reduce the random variation. There is a range of smoother available. We will look at • Moving Average • Simple moving average • Centered moving average • Double Moving average • Local Regression Smoothing

  17. Simple Moving Average • The idea behind the moving averages is that observations which are nearby in time are also likely to be close in value. • The average of the points near an observation will provide a reasonable estimate of the trend-cycle at that observation. • The average eliminate some of the randomness in the data, and leaves a smooth trend-cycle component.

  18. Simple Moving Average • The first question is; how many data points to include in each average. • Moving average of order 3 or MA(3) is when we use averages of three points. • Moving average of order 5 or MA(5) is when we use averages of five points. • The term moving average is used because each average is computed by dropping the oldest observation and including the next observation.

  19. Simple Moving Average • Simple moving averages can be defined for any odd order. A moving average of order k, or MA(k) where k is an odd integer is defined is defined as the average consisting of an observation and the m = (k-1)/2 points on either side. • For example for MA(3)

  20. Simple Moving Average • What is the formula for the MA(5) smoother?

  21. Simple Moving Average • The number of points included in a moving average affects the smoothness of the resulting estimate. • As a rule, the larger the value of k the smoother will be the resulting trend-cycle estimate. • Determining the appropriate length of a moving average is an important task in decomposition methods.

  22. Example: Weekly Department Store Sales • The weekly sales figures (in millions of dollars) presented in the following table are used by a major department store to determine the need for temporary sales personnel.

  23. Example: Weekly Department Store Sales

  24. Example: Weekly Department Store Sales • Calculation of MA(3) and MA(5) smoother for the weekly department store sales. • In applying a k-term moving average, m=(k-1)/2 neighboring points are needed on either side of the observation. • Therefore it is not possible to estimate the trend-cycle close to the beginning and end of series. • To overcome this problem a shorter length moving average can be used.

  25. Example: Weekly Department Store Sales

  26. Centered Moving Average • The simple moving average required an odd number of observations to be included in each average. This was to ensure that the average was centered at the middle of the data values being averaged. • What about moving average with an even number of observations? • For example MA(4)

  27. Centered Moving Average • To calculate a MA(4) for the weekly sales data, the trend cycle at time 3 can be calculated as • The center of the first moving average is at 2.5 (half period early) and the center of the second moving average is at 3.5 (half period late). • How ever the center of the two moving averages is centered at 3.

  28. Centered Moving Average • A centered moving average can be expressed as a single but weighted moving average, where the weights for each period are unequal.

  29. Centered Moving Average • The first and the last term in this average have weights of 1/8 and all the other terms have weights of 1/4. • Therefore a 2MA(4) smoother is equivalent to a weighted moving average of order 5. • In general a 2 MA(k) smoother is equivalent to a weighted moving average of order k+1 with weights 1/k for all observations except for the first and the last observation in the average, which have weights 1/2k.

  30. Least squares estimates • The general procedure for estimating the pattern of a relationship is through fitting some functional form in such a way as to minimize the error component of equation data = pattern + Error • The name least squares is based on the fact that this estimation procedure seeks to minimize the sum of the squared errors in the above equation.

  31. Least squares estimates • A major consideration in forecasting is to identify and fit the most appropriate pattern (functional form) so as to minimize the MSE. • A possible functional form is a straight line. • Recall that a straight line is represented by the equation • Where the two parameters a, and b represent the intercept and the slope respectively.

  32. Least squares estimates • The values a and b can be chosen by minimizing the MSE. • This procedure is known as simple linear regression and will be examined in detail in chapter 5. • One way to estimate trend-cycle is through extending the idea of moving averages to moving lines. • That is instead of taking average of the points, we may fit a straight line to these points and estimate trend-cycle that way.

  33. Least squares estimates • A straight trend line can be represented by the equation • The values of a and b can be found by minimizing the sum of squared errors where the errors are the differences between the data values of the time series and the corresponding trend line values. That is: • A straight trend line is sometimes appropriate, but there are many time series where some curved trend is better.

  34. Least squares estimates • Local regression is a way of fitting a much more flexible trend-cycle curve to the data. • Instead of fitting a straight line to the entire dataset, a series of straight lines will be fitted to sections of the data.

  35. Classical Decomposition • Multiplicative Decomposition • We assume the time series is multiplicative. • This method is often called the “ratio-to moving averages” method.

  36. Deseasonalizing the data and Finding Seasonal Indexes • First the trend-cycle Tt is computed using a centered moving average. This removes the short-term fluctuations from the data so that the longer-term trend-cycle components can be more clearly identified. • These short-term fluctuations include both seasonal and irregular variations. • An appropriate moving average (MA) can do the job.

  37. Deseasonalizing the data and Finding Seasonal Indexes • The moving average should contain the same number of periods as there are in the seasonality that you want to identify. • To identify monthly patter use MA(12) • To identify quarterly pattern use MA(4). • The moving average represents a “typical” level of Y for the year that is centered on that moving average.

  38. Deseasonalizing the data and Finding Seasonal Indexes • Through the following hypothetical example we will see how this procedure works.

  39. Deseasonalizing the data and Finding Seasonal Indexes • The centered moving averages represent the deseasonalized data. • The degree of seasonality, called seasonal factor (SF), is the ratio of the actual value to the deseasonalized value. That is

  40. Deseasonalizing the data and Finding Seasonal Indexes • A seasonal factor greater than 1 indicates a period in which Y is greater than the yearly average, while a seasonal factor less than 1 indicates a period in which y is less than the yearly average. • In our example:

  41. Deseasonalizing the data and Finding Seasonal Indexes • The seasonal indexes are calculated as follows: • The seasonal factors for each of the four quarters (or 12 months) are summed and divided by the number of observations to arrive at the average seasonal factors for each quarter (or month). • The sum of the average seasonal factors should equal the number of periods (4 for quarters and 12 for months). • If it does not, the average seasonal factors should be normalized by multiplying each by the ratio of the number of periods to the sum of the average seasonal factors.

  42. Deseasonalizing the data and Finding Seasonal Indexes • In our example For the third quarter Seasonal factors are 1.311475, 1.371429. • Therefore the average is: • The average of SF for the rest of the quarters is:

  43. Deseasonalizing the data and Finding Seasonal Indexes • The seasonal indexes for the four quarters are:

  44. Finding the Long-Term Trend • The long term movements or trend in a series can be described by a straight line or a smooth curve. • The long-term trend is estimated from the deseasonalized data for the variable to be forecast. • To find the long-term trend, we estimate a simple linear equation as • Where Time =1 for the first period in the data set and increased by 1each quarter(or month) thereafter.

  45. Finding the Long-Term Trend • The method of least squares can be used to estimate a and b. • a and b values can be used to determine the trend equation. • The trend equation can be used to estimate the trend value of the centered moving average for the historical and forecast periods. • This new series is the centered moving-average trend (CMAT).

  46. Finding the Long-Term Trend • For our example,The values of a and b are estimated by using EXCEL regression program.

  47. Finding the Long-Term Trend • The centered moving-average trend equation for this example is • This line is shown along with the graph of Y and the deseasonalized data.

  48. Measuring the Cyclical Component • The cyclical component of a time series is measured by a cycle factor (CF), which is the ratio of the centered moving average (CMA) to the Centered moving average trend (CMAT). • A cycle factor greater than 1 indicates that the deseasonalized value for that period is above the long-term trend of the data. If CF is less than 1, the reverse is true.

  49. Measuring the Cyclical component • If the cycle factor analyzed carefully, it can be the component that has the most to offer in terms of understanding where the industry may be headed. • The length and the amplitude of previous cycles may enable us to anticipate the next tuning point in the current cycle. • An individual familiar with an industry can often explain cyclic movements around trend line in terms of variables or events that can be seen to have had some import. • By looking at those variables or events in the present, one can sometimes get some hint of the likely future direction of the cycle movement.

  50. Business Cycles • Business cycles are wavelike fluctuations in the general level of economic activity. • They are often described by a diagram such as this.

More Related