Modeling Time Series Data Module 5
A Composite Model We can fit a composite model of the form: Sales = (Trend) * (Seasonality) * (Cyclicality) * (Error)
Trend A linear model captures the general upward (or downward) trend with steady growth. Trend is the long term level and the pattern of change in the dependent variable. It is estimated as a simple function of the period number (time). Linear regression or method of least squares is used to estimate the trend.
Seasonality Seasonality captures regular, predictable deviations from the trend. Typical seasons are quarters, weeks, or days. Seasonality is a cycle with a period of exactly one year. We estimate it as a proportion of trend for each season. Data must be available on seasonal basis. Time series decomposition is a method to estimate seasonal component.
Cyclicality Cyclicality captures the effects of long-term macroeconomic boom- bust cycles. It is often difficult to get enough data to measure accurately.
Composite Model Any residual deviations are attributed to random error.
Time Series Decomposition Start with raw data (y) Estimate Seasonal Indices –Compute base trend using centered moving averages (t’) –Estimate seasonal ratios (y/t’) –Average seasonal ratios to get raw seasonal indices –Normalize seasonal indices (s) De-seasonalize the raw data (y/s) Estimate the trend equation using de-seasonalized data (t) Forecast y’ = t * s Calculate error = y – (t*s)
Example: Modeling Trend and Seasonality Toys R Us Revenue (millions $) PerYearQtrRevenue
Example: Computing Moving Averages PerYearQtrRevenueMoving Avg Calculate Moving Average with span of 4 ( ) 4 =
Center Moving Average if using even number of data points ( ) 2 = PerYearQtrRevenueMoving AvgCentered MA Example: Using centered moving averages to estimate base demand
Example: Computing Seasonal Ratios Calculate the ratio of the revenue to the centered moving average =.7628 PerYearQtrRevenue Moving Avg Centered MARatio
Example: Calculating raw Seasonal Indices Calculate the average ratio for each season (quarter) Raw Seasonal Index =.7135 PerYearQtrRevenue Moving Avg Centered MARatio Avg Ratio
Example: Normalizing Seasonal Indices Normalize to make sure Seasonal Indices average to 1.0 (or add up to 4 in this case) =.7124 PerYearQtrRevenue Moving Avg Centered MARatio Avg RatioSI
Example: De-Seasonalizing raw data Deseasonalize observations. = P erYear Qt rRevenue Movin g Avg Centered MARatio Avg RatioSIDeS y’ = y/s
Example: De-Seasonalizing Fit a regression line to the deseasonalized observations – y’ (using time as the independent variable).
Example: De-Seasonalizing Use trend to make deseasonalized predictions - T PerYear Q trRevenue Moving Avg Centered MARatioAvg RatioSIDeSForecast * (1) =
Example: De-Seasonalizing PerYear Q trRevenue Moving Avg Centered MARatio Avg RatioSIDeS Foreca stReS Reseasonalize predictions (T*S) to make forecasts into the future * =
Example: De-Seasonalizing Plot the forecasts – T*S
Example: De-Seasonalizing PerYearQtrRevenue Reseason- alized forecastSquare Error (1026 – ) 2 = 97.0 Average square error As an alternative goodness of fit measure, calculate Root Mean Square Error. RMSE = = 99.3
Example: De-Seasonalizing with Statpro Statpro can be used to calculate seasonal indices. Click on Statpro -> Forecast.
Example: De-Seasonalizing with Statpro Select the dependent variable.
Example: De-Seasonalizing with Statpro Select quarterly data.
Example: De-Seasonalizing with Statpro Select a span of 4 and a moving average method of deseasonalizing.
Example: De-Seasonalizing with Statpro Statpro generates the same values that we calculated manually. (Statpro output)