Time Series Forecasting

Time Series

A time series describes the temporal development of a variable such as sales, stock prices, inventory levels, or even temperature. The observation periods of a time series are regular: the values are recorded annually, monthly, daily, etc. Time series serve as the basis for analyzing past values and also for forecasting future developments. Learn more about different types of time series

Autocorrelation

Autocorrelation means that a time-varying quantity is correlated with itself, shifted by a fixed time unit (lag). For example, the maximum temperatures of a day are positively autocorrelated with the maximum temperatures of the previous day. A very hot day is often followed by another day with a similarly high temperature. This phenomenon can partly be observed in monthly average temperatures as well, as demonstrated by the following time series.

Time series with autocorrelation
Time series showing monthly average temperatures from late 1967 to 1974.

To analyze the internal dependencies within the time series, it is gradually shifted one month into the future at a time. At each step, the correlation with the non-shifted version is calculated, yielding the following autocorrelation plot.

Autocorrelation plot of a time series
Autocorrelation plot of the time series shown above for lags 0 to 7.

The calculated correlation values are plotted as a function of the respective time lag. The autocorrelation plot clearly demonstrates that the individual time series values are not independent of each another. For example, the relatively high correlation value at lag 1 indicates that a single value is strongly influenced by its immediate predecessor.

Cross-correlation and Indicators

Indicator

To model a time series, in addition to intrinsic structural components like trend and seasonality, external context information and influencing factors are often relevant. If an external influencing factor provides relevant information with a temporal lead, it is referred to as an indicator. An indicator anticipates future developments in the time series to be forecasted. The associated temporal shift between the indicator and the time series to be forecasted is called the lag of the indicator. The forecast horizon of a forecasting model with a leading indicator typically corresponds to the lag of the indicator.

Time series with influencing factor Time series with influencing factor and lagged influencing factor
Shifting the external influencing factor three months into the future reveals that upward and downward movements in the (lagged influencing factor) closely align with those in the time series to be forecasted (black). With a three-month lead, the influencing factor anticipates expected developments in the time series and thus provides added value for forecasting. In a forecasting procedure, the influencing factor can therefore be effectively used as an indicator with a lag of 3.

Cross-correlation

Cross-correlation measures how strongly two time series correlate with each other at different time shifts. It essentially examines at which time offset the two time series align best. It is important to note that trends and seasonality in the time series can distort the results and should potentially be removed beforehand.

Time series with lagged influencing factor for cross-correlation Time series with lagged influencing factor for calculating cross-correlation
The influencing factor (yellow) is gradually shifted one month into the future (or past), and its correlation with the reference time series (black) is determined each time.
Cross-correlation plot of time series with an influencing factor Cross-correlation plot of a time series with an influencing factor
The determined correlation values are plotted against the respective time shift (lag) in a graph. It can be seen that the highest correlation between the two factors occurs with a three-month shift into the future.

Forecasting / Prediction

Forecasting refers to the process of identifying historical patterns, such as trends, seasonality, and correlation with potentially relevant factors, based on existing data and projecting them into the futre. The goal is to predict future, currently unknown values as accurately as possible. Forecasting is often based on time series data, such as monthly consumption figures, daily revenue, or weekly material demand. It typically involves the use of appropriate forecasting methods from the field of statistics and machine learning.

Point forecasts

(Point) forecasts are specific single-value estimates for the values of a time series for a future period.

Time series with a forecast or the next 12 months Plot of a time series with forecast for the next 12 months
The transition from known historical time series data (black) to an estimated, future course (blue) for the next 12 months is depicted here. The shaded area surrounding the point forecast illustrates the corresponding confidence interval.

Forecast Period / Forecast Horizon

The forecast period (also called the forecast horizon) refers to the period for which predictions are to be made, e.g., 5 days, 6 months, 7 years.

Time series with a forecast over a forecast period of 12 months Plot of a time series with forecast over a forecast period of 12 months
The forecast horizon extends over 12 months (from early 2018 to early 2019) and seamlessly connects to the end of the historical time series used for modeling.

Forecast Step

The forecast period describes the length of the future time for which forecasts are provided. Depending on the time granularity of the time series, different numbers of forecast steps are needed. For example, for a monthly time series, a forecast period of twelve months will involve twelve forecast steps. For a daily time series, the same period of twelve months will involve about 12 x 30 = 360 forecast steps. As the number of forecast steps increases, the uncertainty typically rises, and thus, the quality of the forecast decreases.

Prediction Interval

A (point) forecast will rarely hit the future actual value exactly. The forecast is always associated with some degree of uncertainty. This uncertainty can be quantified using a prediction interval. The prediction interval describes a range of values around the statistical point forecast, within which the actual future value will fall with a given probability, the prediction confidence level.

Prediction Confidence Level

To quantify the uncertainty of a statistical forecast, the forecast value is accompanied by a prediction interval and an associated prediction confidence level. The confidence level for the interval measures the accuracy of the prediction interval, indicating how likely it is that the interval will cover the future value. The higher the prediction confidence level, the more likely the interval will cover the future value. For example, a prediction confidence level of 95% means that out of 100 prediction intervals calculated in a specific way, 95 will contain the true (future) values of the time series. In approximately 5% of the cases, however, the true values will lie outside of the intervals.

Forecast with a prediction interval for a 95% confidence level Plot of forecasts with prediction interval for 95% confidence level
The light blue shaded area (starting from January 2018) represents the prediction interval. This interval contains the future values of the time series with a probability of 95%.

Forecasting Methods (Fundamentals)

A forecasting method refers to a data-based procedure used to identify certain structures in a time series and make them useful for a forecast. It essentially defines the rules for creating the forecast and estimates the most appropriate forecasting model for the given time series. There are various classical statistical forecasting methods. Regression or machine learning techniques can also be used as forecasting methods. Different methods focus on different structural components of the time series (trend, seasonality, external influences, adaptability, etc.). Important examples of statistical forecasting methods include the moving average and exponential smoothing. Finding the most suitable method for a given time series, with appropriate settings, is the subject of model selection.

Specific forecasting methods are explained on this page.

Model Selection and Validation

Covariate / Influencing Factor

A covariate in a (statistical) forecasting model refers to an influencing factor that acts as a predictor, i.e., it potentially influences the dependent variable being forecasted and is therefore considered in the forecasting model. For example, the daily maximum temperature might be a covariate for modeling and forecasting the daily electricity consumption of a city.

Forecast Error

A forecast error refers to the difference between the predicted and the actual value that occurred.

Forecast with Forecast Error Comparison of forecasts and actual values in time series forecasting
The predicted values (blue line) and the actual observed data (black line) differ by the respective forecast errors (residuals), which are marked by the red vertical distances.

Goodness Measure

To evaluate the quality of a model, different goodness measures can be constructed or applied. Most of these goodness measures are based on an evaluation of the forecast errors. Examples of such criteria include MAE (Mean Absolute Error), MAPE (Mean Absolute Percentage Error), MSE (Mean Squared Error), and PIS (Periods in Stock). Learn more about forecast errors and goodness measures/performance metrics

Backtesting

Backtesting refers to a strategy for evaluating the quality of a forecast model. In this process, the model's forecasts for a past period (e.g., the past year) are simulated. These are then compared with the already known actual values for that period. Learn more about backtesting

Model Selection

In model selection, the most appropriate forecast model for a given time series is automatically identified, and the corresponding model parameters are optimally adjusted. Learn more about model selection

Ensemble Methods

Ensemble methods combine the individual forecasts of various base models (e.g., ARIMA, exponential smoothing, ...) into a single overall forecast. The core idea behind an ensemble is that by combining the different models, individual tendencies are balanced out, leading to a forecast with higher quality. The selection and weighting of the base models for the ensemble can be done based on the results of each model from the backtesting.

Aggregation

Hierarchical Aggregation

In many cases, time series are organizationally-hierarchically structured or can be grouped and aggregated into different levels using context attributes. For example, when looking at monthly sales data for items, the total sales of all items, the total sales of all items per region, the sales of each individual item, or even the sales of each individual item per customer might be considered.

When identifying an optimal aggregation level for modeling and forecasting, the specific application goal plays a central role, as well as the question of which level allows the best identification and learning of patterns, structures, and relationships in the data.

With hierarchical forecasts, multiple organizational-hierarchical levels can be linked, and consistent forecasts across these levels can be generated. Learn more about hierarchical aggregation

Temporal Aggregation

Through temporal aggregation, a time series is transformed into a new time series with coarser time granularity. For example, a monthly time series of monthly sales can be aggregated into a yearly time series of annual sales by summing the twelve monthly sales. In this example, summation is used as the aggregation function; depending on the specific question, other functions, such as the mean, median, or maximum, might be considered.

For forecasting, it is usually appropriate to choose the time granularity that corresponds to the forecasting goal. If the goal is to forecast the sales for the next few months, the monthly time series of monthly sales should be used as the data basis. The alternative approach of forecasting daily sales based on daily data and then aggregating the forecasts temporally to obtain monthly sales predictions usually leads to less accurate forecasts. The same holds true for the calculation of monthly sales forecasts from a predicted annual sales total (by dividing by the number of months). However, for long forecast horizons, the usual monthly-based forecasts can often be improved by combining them with the latter approach. Learn more about temporal aggregation

You are about to leave our website via an external link. Please note that the content of the linked page is beyond our control.

Choose Your Dashboard

futureNOW

Established CHECK-IN process, intuitive FORECAST for single time series with POOL browsing capabilities.

Login NOW
Beta

futureEXPERT Dashboard

CHECK-IN, POOL, ASSOCIATOR, MATCHER and FORECAST capabilities for multiple time series without touching code.

Also perfect for those who want to use Python later – learn the workflow and get code output.

EXPERT Login
Tip: For the best experience with futureEXPERT Dashboard in current beta phase, start with CHECK-IN via futureNOW and find the link to continue in futureEXPERT Dashboard.

futureEXPERT Python Library

Full control, flexibility and easy integration for beginners and advanced users via Python. Also check out the various guides and use cases in the included Jupyter notebooks.

Get started

Cookies und andere (Dritt-)Dienste

Diese Website speichert Cookies auf Ihrem Computer nur, wenn Sie dem ausdrücklich zustimmen. Bei Zustimmung werden insbesondere auch Dritt-Dienste eingebunden, die zusätzliche Funktionalitäten, wie beispielsweise die Buchung von Terminen, bereitstellen. Diese Cookies und Dienste werden verwendet, um Informationen darüber zu sammeln, wie Sie mit unserer Website interagieren, und um Ihre Browser-Erfahrung zu verbessern und anzupassen. Zudem nutzen wir diese Informationen für Analysen und Messungen zu unseren Besuchern auf dieser Website und anderen Medien. Weitere Informationen zu den von uns verwendeten Cookies und Dritt-Diensten finden Sie in unseren Datenschutzbestimmungen.