290 likes | 310 Views
Understand how to analyze time series data by separating patterns, identifying components like trend cycles and seasonal factors, and choosing between additive and multiplicative decomposition models.
E N D
Time series Decomposition Farideh Dehkordi-Vakil Speaker:YongqianSun
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.
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
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 (trendcycle, Seasonality , error)
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.
Decomposition Model • The exact functional form depends on the decomposition model actually used. Two common approaches are: • Additive Model • Multiplicative Model
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.
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.
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
Trend-Cycle Estimation • HowtoestimateTrend-Cycle • Moving Average • Simple moving average • Centered moving average • Local Regression Smoothing • Least squares estimates
Simple Moving Average • Simple moving average can be defined for any odd order. A moving average of order k, or MA(k) where k is an odd integer is defined as the average consisting of an observation and the m = (k-1)/2 points on either side. • For example for MA(3)
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.
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.
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.
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)
Centered Moving Average • To calculate a MA(4), the trend cycle at time 3 can be calculated asfollws:
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 2MA(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.
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.
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(meansquareerror). • A possible functional form is a straight line. • ThentheMSEcanbedescribedasfollows: min Usetheabovetwoformulates,wecanobtain:
Example:Least squares estimates Yt= -9.4995 + 9.5004 t (I have neglected some intermediate computational process.)
Conclude:Trend-Cycle Estimation • Instead of fitting one straight line to the entire dataset, a series of straight lines will be fitted to sections of the data. • A straight trend line is notalways appropriate, there are many time series where some curved trend is better.Thenthetrendmaybelikethese:
SeasonalAdjustment • Howtodeterminetheseasonalfactors • ForAdditivemodel • Averagebyseasons • Formultiplicativemodel • Calculatetheseasonalindexesusetheaveragebyseasons
Conclude: : Seasonal Adjustment • Thispartonlyintroducedoneofthesimplestmethodstocalculatetheseasonalfactor. • Therearesomemorecomplexapproaches:movingaveragebyseasonswithweights, curve fitting algorithmusingcos(x).etc.