Seasonal indices
Seasonality refers to predictable variations that occur at regular time intervals. It can be caused by a variety of factors, including natural phenomena such as weather or the number of daylight hours, along with cultural milestones such as holidays or even the schedules of popular organized sports. In any case, seasonality reflects repetitive and generally regular patterns identified in the time series. And, in some cases, seasonal factors can also influence the patterns of other seasonal factors. Seasonality can be identified with a minimum of 1.5 seasonal cycles.
Attempts to represent seasonality in a mathematical model face two challenges:
- Modeling multiple seasonal patterns that could exist
- Identifying the interval at which a seasonal pattern exists
For an example of multiple seasonal patterns, consider demand for electricity over the course of a year. The demand can exhibit a 24-hour pattern that aligns with the daily schedule within a typical household, followed by a weekly pattern that aligns closely with work days and the weekend. A third level of seasonality can emerge from the natural variations in weather patterns over the course of a year. Therefore, it becomes necessary to first identify and include all the above patterns within the model.
As demonstrated in this example, it becomes imperative to identify the interval at which a seasonal pattern repeats itself. A common fallacy is that seasonality always repeats in predictable intervals, such as weekly aggregated time series exhibiting a 52-weekly pattern, or a monthly aggregated time series exhibiting a 12-monthly pattern, and so on. But while this may be true for many time series, and companies, the advent of shorter product life cycles and variation in promotion cycles during different phases of the life cycle leads to patterns that might not conform to a 52-week or 12-month cycle.
Demand Guru adopts a periodogram approach that is often used by biological researchers to detect seasonal patterns in time series. Because the detection of seasonal patterns can be adversely affected by the presence of outliers such level shifts, other point outliers, and even the presence of a linear or cyclical trend, the algorithm is modified so that the seasonal pattern is confirmed only after accounting for other sources of non-stationarity present within the data. To also robustify the algorithm to any remnant noise that may be present within the data, the adopted algorithm is further improvised by sampling the time series several times, repeating the process, and then the average value of the test statistic is used to confirm the presence of a seasonal pattern of a specific periodicity.
Once the seasonal pattern intervals are identified, an average demand profile is constructed that can be attributed to a seasonal pattern and then used as a causal in the algorithm. This enables the algorithm to determine what seasonal pattern is important, and consider the interaction between some of these patterns at several time periods.
The blue line in the following graph indicates seasonal demand that can be attributed to that of a 12-month cycle:
The Causal Summary report shows the following:
Detecting seasonality with less than two seasonal cycles
While seasonal indices within Demand Guru represent the average demand that can be attributed towards a specific time point in the seasonal cycle, at least two complete seasonal cycles are required in the dataset for such indices to be detected. This requirement can fail to yield the best fit, specifically under the following two conditions:
- If the dataset falls marginally short of having two complete seasonal cycles, you might fail to identify seasonal patterns that may still be present in the data.
- If the demand time series is “noisy" at the current aggregation level, aggregation to a higher time bucket could reveal a seasonal pattern.
To improve the accuracy of Demand modeling when a seasonality of lower frequency cannot be identified in the time series, Demand Guru performs the following:
- Determines the natural frequency of the data, based on the assumption that most time series exhibit a yearly seasonal pattern. The number of data points in the time period required to complete a yearly cycle is described as the natural frequency of the data. The natural frequency for several aggregation levels are as follows:
- Week: Natural frequency of seasonality is 52 weeks.
- Month: Natural frequency is 12 months.
- Quarter: Natural frequency of the data is 4 quarters.
- Checks the seasonal cycles detected in the data. In some cases, this may result in no seasonality detected; however, partial seasonality may be detected. Suppose partial seasonality identification includes detecting a monthly cycle (4-5 weeks) or quarterly cycle (13 weeks) in weekly data rather than the yearly cycle (52 weeks). If the partial seasonality identified is less than 35 % of the natural frequency of the data, Demand Guru performs the following:
- Weekly data is aggregated up to monthly and quarterly levels to determine the proportion of sales for every month or quarter.
- Monthly data is aggregated up to quarterly levels to determine the proportion of sales for every quarter.
- Daily data is aggregated into weekly, monthly, and quarterly time buckets to calculate the proportion of sales at those levels.
Example 1: Seasonality when less than two complete seasonal cycles are available
In this example, the out-of-sample error (MAPE) improves by approximately 33 %.
Example 2: Seasonality when noisy data does not reveal seasonality at the aggregation level specified by the user
In this example, when the data is noisy at the monthly level, aggregating and detecting seasonality at the quarterly level improves out-of-sample error by approximately 38%.
The causals are labeled monthWeights, quarterWeights, or weekWeights, and included in the Causal Summary Table as Algorithm Generated Causals.
Last modified: Thursday December 19, 2024