Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modeling Time Series Data Module 5. A Composite Model We can fit a composite model of the form: Sales = (Trend) * (Seasonality) * (Cyclicality) * (Error)

Similar presentations


Presentation on theme: "Modeling Time Series Data Module 5. A Composite Model We can fit a composite model of the form: Sales = (Trend) * (Seasonality) * (Cyclicality) * (Error)"— Presentation transcript:

1 Modeling Time Series Data Module 5

2 A Composite Model We can fit a composite model of the form: Sales = (Trend) * (Seasonality) * (Cyclicality) * (Error)

3 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.

4 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.

5 Cyclicality Cyclicality captures the effects of long-term macroeconomic boom- bust cycles. It is often difficult to get enough data to measure accurately.

6 Composite Model Any residual deviations are attributed to random error.

7 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)

8 Example: Modeling Trend and Seasonality Toys R Us Revenue (millions $) PerYearQtrRevenue 1199211026.00 2199221056.00 3199231182.00 4199242861.00 5199311172.00 6199321249.00 7199331346.00 8199343402.00 9199411286.00 10199421317.00 11199431449.00 12199443893.00 13199511462.00 14199521452.00 15199531631.00 16199544200.00 17199611776.25 18199621808.25 19199631941.75 20199644128.75

9 Example: Computing Moving Averages PerYearQtrRevenueMoving Avg 1199211026.00 2199221056.00 3199231182.001531.3 4199242861.001567.8 5199311172.001616.0 6199321249.001657.0 7199331346.001792.3 8199343402.001820.8 9199411286.001837.8 10199421317.001863.5 11199431449.001986.3 12199443893.002030.3 13199511462.002064.0 14199521452.002109.5 15199531631.002186.3 16199544200.002264.8 17199611776.252353.9 18199621808.252431.6 19199631941.752413.8 20199644128.75 Calculate Moving Average with span of 4 (1026 + 1056 + 1182 + 2861) 4 = 1531.3

10 Center Moving Average if using even number of data points (1531.3 + 1567.8) 2 = 1549.5 PerYearQtrRevenueMoving AvgCentered MA 1199211026.00 2199221056.00 3199231182.001531.31549.5 4199242861.001567.81591.9 5199311172.001616.01636.5 6199321249.001657.01724.6 7199331346.001792.31806.5 8199343402.001820.81829.3 9199411286.001837.81850.6 10199421317.001863.51924.9 11199431449.001986.32008.3 12199443893.002030.32047.1 13199511462.002064.02086.8 14199521452.002109.52147.9 15199531631.002186.32225.5 16199544200.002264.82309.3 17199611776.252353.92392.7 18199621808.252431.62422.7 19199631941.752413.8 20199644128.75 Example: Using centered moving averages to estimate base demand

11 Example: Computing Seasonal Ratios Calculate the ratio of the revenue to the centered moving average 1182 1549.5 =.7628 PerYearQtrRevenue Moving Avg Centered MARatio 1199211026.00 2199221056.00 3199231182.001531.31549.50.7628 4199242861.001567.81591.91.7973 5199311172.001616.01636.50.7162 6199321249.001657.01724.60.7242 7199331346.001792.31806.50.7451 8199343402.001820.81829.31.8598 9199411286.001837.81850.60.6949 10199421317.001863.51924.90.6842 11199431449.001986.32008.30.7215 12199443893.002030.32047.11.9017 13199511462.002064.02086.80.7006 14199521452.002109.52147.90.6760 15199531631.002186.32225.50.7329 16199544200.002264.82309.31.8187 17199611776.252353.92392.70.7424 18199621808.252431.62422.70.7464 19199631941.752413.8 20199644128.75

12 Example: Calculating raw Seasonal Indices Calculate the average ratio for each season (quarter)..7162 +.6949 +.7006 +.7424 4 Raw Seasonal Index =.7135 PerYearQtrRevenue Moving Avg Centered MARatio Avg Ratio 1199211026.00 2199221056.00 3199231182.001531.31549.50.7628 4199242861.001567.81591.91.7973 5199311172.001616.01636.50.71620.7135 6199321249.001657.01724.60.72420.7077 7199331346.001792.31806.50.74510.7406 8199343402.001820.81829.31.85981.8444 9199411286.001837.81850.60.6949 10199421317.001863.51924.90.6842 11199431449.001986.32008.30.7215 12199443893.002030.32047.11.9017 13199511462.002064.02086.80.7006 14199521452.002109.52147.90.6760 15199531631.002186.32225.50.7329 16199544200.002264.82309.31.8187 17199611776.252353.92392.70.7424 18199621808.252431.62422.70.7464 19199631941.752413.8 20199644128.75

13 Example: Normalizing Seasonal Indices Normalize to make sure Seasonal Indices average to 1.0 (or add up to 4 in this case).7135..7135+.7077+.7406+1.844 =.7124 PerYearQtrRevenue Moving Avg Centered MARatio Avg RatioSI 1199211026.00 0.7124 2199221056.00 0.7066 3199231182.001531.31549.50.7628 0.7394 4199242861.001567.81591.91.7973 1.8415 5199311172.001616.01636.50.71620.71350.7124 6199321249.001657.01724.60.72420.70770.7066 7199331346.001792.31806.50.74510.74060.7394 8199343402.001820.81829.31.85981.84441.8415 9199411286.001837.81850.60.6949 0.7124 10199421317.001863.51924.90.6842 0.7066 11199431449.001986.32008.30.7215 0.7394 12199443893.002030.32047.11.9017 1.8415 13199511462.002064.02086.80.7006 0.7124 14199521452.002109.52147.90.6760 0.7066 15199531631.002186.32225.50.7329 0.7394 16199544200.002264.82309.31.8187 1.8415 17199611776.252353.92392.70.7424 0.7124 18199621808.252431.62422.70.7464 0.7066 19199631941.752413.8 0.7394 20199644128.75 1.8415

14 Example: De-Seasonalizing raw data Deseasonalize observations. = 1440.2 P erYear Qt rRevenue Movin g Avg Centered MARatio Avg RatioSIDeS 1199211026.00 0.71241440.2 2199221056.00 0.70661494.4 3199231182.001531.31549.50.7628 0.73941598.5 4199242861.001567.81591.91.7973 1.84151553.6 5199311172.001616.01636.50.71620.71350.71241645.1 6199321249.001657.01724.60.72420.70770.70661767.6 7199331346.001792.31806.50.74510.74060.73941820.3 8199343402.001820.81829.31.85981.84441.84151847.4 9199411286.001837.81850.60.6949 0.71241805.1 10199421317.001863.51924.90.6842 0.70661863.8 11199431449.001986.32008.30.7215 0.73941959.6 12199443893.002030.32047.11.9017 1.84152114.0 13199511462.002064.02086.80.7006 0.71242052.2 14199521452.002109.52147.90.6760 0.70662054.9 15199531631.002186.32225.50.7329 0.73942205.7 16199544200.002264.82309.31.8187 1.84152280.7 17199611776.252353.92392.70.7424 0.71242493.3 18199621808.252431.62422.70.7464 0.70662559.0 19199631941.752413.8 0.73942626.0 20199644128.75 1.84152242.0 1026.7124 y’ = y/s

15 Example: De-Seasonalizing Fit a regression line to the deseasonalized observations – y’ (using time as the independent variable).

16 Example: De-Seasonalizing Use trend to make deseasonalized predictions - T PerYear Q trRevenue Moving Avg Centered MARatioAvg RatioSIDeSForecast 1199211026.00 0.71241440.21430.3 2199221056.00 0.70661494.41487.3 3199231182.001531.31549.50.7628 0.73941598.51544.2 4199242861.001567.81591.91.7973 1.84151553.61601.1 5199311172.001616.01636.50.71620.71350.71241645.11658.0 6199321249.001657.01724.60.72420.70770.70661767.61715.0 7199331346.001792.31806.50.74510.74060.73941820.31771.9 8199343402.001820.81829.31.85981.84441.84151847.41828.8 9199411286.001837.81850.60.6949 0.71241805.11885.8 10199421317.001863.51924.90.6842 0.70661863.81942.7 11199431449.001986.32008.30.7215 0.73941959.61999.6 12199443893.002030.32047.11.9017 1.84152114.02056.6 13199511462.002064.02086.80.7006 0.71242052.22113.5 14199521452.002109.52147.90.6760 0.70662054.92170.4 15199531631.002186.32225.50.7329 0.73942205.72227.4 16199544200.002264.82309.31.8187 1.84152280.72284.3 17199611776.252353.92392.70.7424 0.71242493.32341.2 18199621808.252431.62422.70.7464 0.70662559.02398.2 19199631941.752413.8 0.73942626.02455.1 20199644128.75 1.84152242.02512.0 56.93 * (1) + 1373.4 = 1430.3

17 Example: De-Seasonalizing PerYear Q trRevenue Moving Avg Centered MARatio Avg RatioSIDeS Foreca stReS 1199211026.00 0.71241440.21430.31019.0 2199221056.00 0.70661494.41487.31050.9 3199231182.001531.31615.50.7317 0.73941598.51544.21141.8 4199242861.001699.7 1.6833 1.84151553.61601.12948.5 ------------ 13199511462.001457.01486.00.9838 0.71242052.22113.51505.7 14199521452.001515.01850.60.7846 0.70662054.92170.41533.7 15199531631.002186.32225.50.7329 0.73942205.72227.41647.0 16199544200.002264.82309.31.8187 1.84152280.72284.34206.6 17199611776.252353.92392.70.7424 0.71242493.32341.21667.9 18199621808.252431.62422.70.7464 0.70662559.02398.21694.6 19199631941.752413.8 0.73942626.02455.11815.4 20199644128.75 1.84152242.02512.04625.9 210.712412568.91830.2 220.706622625.91855.5 230.739442682.81983.8 241.841532739.75045.3 Reseasonalize predictions (T*S) to make forecasts into the future. 2568.9 *.71241 = 1830.2

18 Example: De-Seasonalizing Plot the forecasts – T*S

19 Example: De-Seasonalizing PerYearQtrRevenue Reseason- alized forecastSquare Error 11992110261018.98397.00468 21992210561050.92751.54981 31992311821141.8322950.947 41992428612948.5032257.815 51993111721181.217167.3762 61993212491211.8412765.401 71993313461310.2192341.483 81993434023367.862343.6507 91994112861343.456503.07 101994213171372.7556225.828 111994314491478.6071603.193 121994438933787.2213299.437 131995114621505.6843759.864 141995214521533.66913358.15 151995316311646.995467.8932 161995442004206.58112.7695 17199611776.251667.91723123.7 18199621808.251694.58425875.59 19199631941.751815.38229205.72 20199644128.754625.9472893.41 9865.2 (1026 – 1018.98) 2 = 97.0 Average square error As an alternative goodness of fit measure, calculate Root Mean Square Error. RMSE = 9865.2 = 99.3

20 Example: De-Seasonalizing with Statpro Statpro can be used to calculate seasonal indices. Click on Statpro -> Forecast. http://www.indiana.edu/~mgtsci/StatPro.html

21 Example: De-Seasonalizing with Statpro Select the dependent variable.

22 Example: De-Seasonalizing with Statpro Select quarterly data.

23 Example: De-Seasonalizing with Statpro Select a span of 4 and a moving average method of deseasonalizing.

24 Example: De-Seasonalizing with Statpro Statpro generates the same values that we calculated manually. (Statpro output)


Download ppt "Modeling Time Series Data Module 5. A Composite Model We can fit a composite model of the form: Sales = (Trend) * (Seasonality) * (Cyclicality) * (Error)"

Similar presentations


Ads by Google