Home Data Science How to predict hierarchical time series?

How do you forecast hierarchical time series?

When it comes to forecasting time series, the end always justifies the means, i.e. the most accurate model is the model of choice. However, the model should always be kept as simple as possible to minimize the risk of overfitting. Data-driven algorithms usually forecast time series univariately, i.e. each observation series is modeled separately.

This means that a time series, such as the profit of a company, is first examined for central characteristics and modelled on the basis of these:

On this basis, the corresponding time series is predicted over the desired horizon. The Smart Predict functionality in the SAP Analytics Cloud offers a good introduction to the prediction of time series. For the implementation of more complex and individualised methods, statistical software solutions such as R or Python are suitable.

 

For more on forecasting time series in general (including definition, function, and forecasting models), see this wiki article.

 What are hierarchical time series? 

Hierarchical time series are omnipresent in every company, for example in the form of a profit and loss account (P&L) or balance sheet hierarchy.

For the sake of simplicity, in this article we will consider a simple P&L hierarchy with three levels. The top level of the hierarchy consists of only one line item, the Corporate profit. This result is the sum of the two time series Expense and Incomewhich are on the middle level. At the lowest level are the so-called basic time series Personnel costs, Material costs, Sales revenue and extraordinary income are located here. The expenses the sum of personnel- and material coststhe Yield the sum of revenues and extraordinary income. Thus, we consider a total of seven time series, with the observations of the upper two levels, i.e. Corporate earnings, expense and Yieldare merely aggregations of the basic time series.

In practice, hierarchies in corporations are much more complex, so that ten or more levels are not uncommon. However, the three levels in the previous example are sufficient to explain all the essential concepts related to forecasting hierarchical time series.

Methods for forecasting hierarchical time series 

The simplest approach would be to choose the most accurate model for each of the seven time series in the described hierarchy and let it produce a forecast. However, this approach violates the structure of the hierarchy. For example, the forecast of the Effort is usually not equal to the sum of the predictions for the personnel costs and the cost of materials. To fulfil this necessary condition of the hierarchy, three methods exist, which are briefly explained below:

Probably the most intuitive approach forecasts only the basic time series - in this case Personnel costs, Material costs, sales revenue and extraordinary income, using common algorithms. Then the forecasts are aggregated according to the hierarchy described above, i.e. the forecast of the expense is the sum of the forecasts for personnel costs and the Cost of materials.

Although this method is the most obvious variant at first glance, it has its weaknesses, especially in the case of complex and multi-layered hierarchies. This is due to the fact that the time series at the lowest levels often have little structure and are therefore difficult to forecast. Thus, significant forecasting errors can occur here. If the forecasts of these basic time series are now aggregated over numerous hierarchical levels, the danger of aggregating forecast errors is also real. Under certain circumstances, this can lead to strong deviations in the most important business indicators, which are usually located at the higher hierarchy levels.

Alternatively, one can only use the time series on the highest hierarchical level, in the scenario described the company resultusing a suitable algorithm. This has the advantage that this indicator usually has a solid structure and can therefore be forecast accurately. Unfortunately, it is not intuitively clear how this forecast is distributed to the lower levels. There are different approaches here, for example, the forecast of the company's earnings based on the historical weights on the forecasts for the expense and the earnings and so on. The disadvantage of this approach is that any trends and seasonalities in the base time series may be ignored in the forecasts.

This approach is a hybrid of "bottom-up" and "top-down". Statistical methods are used to directly forecast the positions of a level that corresponds to neither the lowest nor the highest level. In our example, this would be the time series of the middle hierarchical level, the Effort and the Yield. The predictions of all items on the levels above, here the Company's earnings, would be determined using bottom-up. On the other hand, the forecasts of the time series on the levels below, here Personnel costs, Material costs, sales revenue and extraordinary income, according to a top-down approach.

 

Conclusion 

The approaches presented are only the basic outlines of the range of methods available. There are numerous parameters that can be adjusted, such as the disaggregation method within the top-down approach. Users should first answer for themselves what they primarily want to achieve with the forecast. Do they deal with multi-layered hierarchical structures and the focus is mainly on a preview of the decisive business key figures? In this case, a top-down or middle-out approach, which starts at an upper level, is advisable. If, on the other hand, all current developments are to be mapped in order to be able to react to them as quickly and flexibly as possible? Then a bottom-up or middle-out approach is more advisable, which starts at a lower level. Overall, unfortunately, it is not possible to make a general statement about which method delivers the best results. It is necessary to first answer the above questions, then test the different options, evaluate them objectively and select the best alternative for the scenario at hand.

Would you like to know more?

Would you like to delve deeper into this topic? Then we would be happy to present the forecasting of hierarchical time series to you in person - very much in combination with details on other functions of the SAP Analytics Cloud. Simply get in touch with us!

Your analytics contact
Nadine Matt_2
Nadine Matt
Customer Engagement & Communication Executive

Published by:

Dr. Dominik Bertsche

Professional Analytics consultant

author

How did you like the article?

How helpful was this post?

Click on a star to rate!

Average rating 5 / 5.
Number of ratings: 2

No votes so far! Be the first person to rate this post!

INFORMATION

More information

Wiki How to R - Beginners Guide (1)

How to R - Beginner Guide Time Series Analysis

In this small tutorial, we will limit ourselves to briefly outlining the essential steps in time series analysis in the programming language R...

EU Taxonomy Wiki

EU taxonomy - implementation in an SAP Analytics system

From KPI definition to reporting: Evaluate your company's sales, CapEx and OpEx activities in accordance with the EU taxonomy criteria. We accompany you step by step in the successful implementation of the EU taxonomy guidelines...

Wiki SCT

Sustainability Control Tower (SCT)

At a time when sustainable business practices are indispensable, the focus is increasingly on monitoring and recording one's own sustainability performance using precise data. The SAP Sustainability Control Tower is a comprehensive sustainability solution that enables holistic reporting...

Wiki What is R

What is R?

R is a programming language designed for statistical applications, which enjoys a high degree of diffusion especially in the field of Data Science...

Wiki Five sustainability KPIs

The five most important sustainability KPIs

Why do you need sustainability KPIs? What are the 5 most important sustainability KPIs? And why are sustainability KPIs important for your company? These questions are answered in the following article...

Wiki Datasphere vs BW4HANA

Comparison: SAP Datasphere vs. SAP BW/4HANA

With solutions such as SAP BW/4HANA and SAP Datasphere, SAP offers different data warehousing options. While BW/4HANA specializes in structured enterprise data and analytics, Datasphere focuses on comprehensive data integration across platforms...

Wiki Managed Cloud Services

Managed cloud services

Managed cloud services enable organizations to reap the benefits of cloud technology without having to deal with the complexities of cloud management...

GDPR Cookie Consent with Real Cookie Banner