Time Series Forecasting

Niklas Donges Niklas Donges
May 28, 2019 AI & Machine Learning

Time Series forecasting is a very important area of machine learning because there are a lot of prediction tasks that involve a time component. Examples are the prediction of a stocks closing price or forecasting a companies sales. After reading this post you will know about the basic concepts of Time Series Forecasting and how a business takes advantage of it.

Table of Contents:

  • What is Time Series Forecasting?
  • What is a Time Series?
  • Why Order Matters
  • How is it used?
  • Simple Forecasting Methods
  • Time Series Plots
  • Trends
  • Seasonality
  • Seasonality Plots
  • Cyclical Patterns
  • What is Time Series Forecasting?

Time Series Forecasting is an important area of machine learning with the goal to predict things that involve a time component. It is often neglected because the involved time component makes it a bit harder. It basically allows us to forecast any variable that can be tracked and collected over time. Examples are a stocks closing price, annual population data or sales figures. A Time Series Forecasting model is just using the collected data to forecast future values.

What is a Time Series?

A time series is a series of data points that are listed in time order. It is a sequence of data points that covers a continuous time interval. A Time Series has equal spacing between two measurements that follow each other. Each time-unit, within the time interval, has mostly one data point.

Why Order Matters

Correct Ordering within a Time Series is very important because there is a dependency on time. If the order is changed, it could change the meaning of the data. To predict future values, each data measurement must be taken across sequential and equal intervals, where each time unit has at most one data point.

How is it used?

To better explain how a company uses and benefits from Time Series forecasting methods, we will go through an example of the European drug store company Rossmann. Rossmann uses Time Series Forecasting to predict sales using store, promotion, and competitor data that enable their store managers to create effective staff schedules that increase productivity and motivation. This helps store managers stay focused on what’s most important to them: their customers and their teams! 

Their Data Scientists and Machine Learning engineers work along with a dataset that contains data from the last few years. Once the data is collected, they have two objectives in mind. First, they need to identify patterns and trends within the sequence of the data and second, they need to predict the future values of the time series. They investigate and clean the data, then they determine trends and seasonal components. Afterwards, they apply it to a Time Series tool like ARIMA or ETS, to forecast the Sales for the next weeks and use these within their planning. 

Simple Forecasting Methods

There are a few simple forecasting methods, that didn’t use any machine learning, which we should talk about before we continue going deeper into the topic. Of course, these simple methods have their faults and are only occasionally effective.

The first method is the average method. Here the forecast is simply the average of all our previous data. The model assumes that the best predictor of what will happen tomorrow is the average of everything that has happened up until now.

The second method is the moving average method. Here the method uses the average of a given time series over a defined number of periods.

The third method is the Naive method, where you just use the value of the last observation as a forecast for the next one. If you have not enough data to build a predictive model, these methods can supplement rough forecasts for the near future. There is also the seasonal naive method that assumes the magnitude of the seasonal pattern will remain constant.

Time Series Plots

A time series plot shows a graphical presentation of the relationship between the data and time. The Time is displayed on the horizontal axis and the target variables values are shown on the vertical access. Plotting out the time series allows us to spot patterns and behaviors, that might stay undetected without it. The insights we gained from visualizing our Time Series can then be used to fine-tune sophisticated forecasting models.

Bildschirmfoto 2018-01-05 um 15.36.16.png

Trends

A trend is a movement to relatively higher highs or lower lows over a long period of time. Higher highs that follow higher lows are defined as an uptrend, while lower lows followed by lower highs define a downtrend. If the movement doesn’t really produce any higher highs or lower lows we call that a horizontal trend. If we have for example an uptrend, statistically the trend is more likely to continue.

Bildschirmfoto 2018-01-05 um 15.54.05.png

Let’s explain this further with an example. If a company continuously acquires new costumers that spend money on their products, they would experience an uptrend. In the opposite case, they would experience a downtrend. During the shift from the upward to the downward trend, the number of costumers is remaining nearly the same, which results in a horizontal trend.

Seasonality

A Time Series that shows a repeating pattern at fixed intervals of time, within a one year period, is called a seasonal pattern or seasonality. Seasonal patterns can be spotted across many kinds of time series. A example is that your heating costs reduce in the summer and rise in the winter. Companies need to understand seasonality to properly manage their inventory, staff and many other important things.

Seasonality Plot

A seasonality plot is a good way to spot seasonal patterns through visual observation. Let’s take a look at the picture below, which is a seasonality plot of a hotel. On the vertical axes, you can see the number of bookings the hotel received and at the horizontal axes, you can see the months in chronological order. You can see that the results between summer and winter months are significantly different. A reason for that is probably that many people want to go skying in the winter months and therefore there are more sales in the winter. Because of that, we can safely say that our time series contains seasonality.

Another thing that we can spot at the seasonality plot is that the number of bookings increases a little bit year after year.

 

Bildschirmfoto 2018-01-06 um 10.25.56

Cyclical Patterns

A pattern within data that includes rises and falls that are not of a fixed period, is called a Cyclical pattern. So a pattern that doesn’t occur within the same calendar year, is probably a Cyclical pattern. These patterns last several years and don’t have a repeating pattern within each year.

Think of stock market cycles that last a few years where the length of a current cycle is unknown. In the world of stocks, a cyclical uptrend is called a bull market and a cyclical downtrend is called a bear market. Cyclical patterns are often times confused with seasonal patterns but be aware of the fact that they are quite different. Let’s go back to our stock market example. If the market fluctuations are not of a fixed period, they belong to cyclical behavior. If they do and if they are also associated with some aspects of the calendar, they belong to seasonal behavior.

Note that the average cyclical pattern last’s longer than the average seasonal pattern. Also, the magnitude of cyclical patterns is likely to change more often than the ones of seasonal patterns. On top of that cyclical patterns are way harder to predict. Think of predicting a stock market crash, which is nearly impossible without insider information.

  • Experfy Insights

    Top articles, research, podcasts, webinars and more delivered to you monthly.

  • Niklas Donges

    Tags
    Machine Learning
    © 2021, Experfy Inc. All rights reserved.
    Leave a Comment
    Next Post
    Three key pitfalls to avoid in ANY automation

    Three key pitfalls to avoid in ANY automation

    Leave a Reply Cancel reply

    Your email address will not be published. Required fields are marked *

    More in AI & Machine Learning
    AI & Machine Learning,Future of Work
    AI’s Role in the Future of Work

    Artificial intelligence is shaping the future of work around the world in virtually every field. The role AI will play in employment in the years ahead is dynamic and collaborative. Rather than eliminating jobs altogether, AI will augment the capabilities and resources of employees and businesses, allowing them to do more with less. In more

    5 MINUTES READ Continue Reading »
    AI & Machine Learning
    How Can AI Help Improve Legal Services Delivery?

    Everybody is discussing Artificial Intelligence (AI) and machine learning, and some legal professionals are already leveraging these technological capabilities.  AI is not the future expectation; it is the present reality.  Aside from law, AI is widely used in various fields such as transportation and manufacturing, education, employment, defense, health care, business intelligence, robotics, and so

    5 MINUTES READ Continue Reading »
    AI & Machine Learning
    5 AI Applications Changing the Energy Industry

    The energy industry faces some significant challenges, but AI applications could help. Increasing demand, population expansion, and climate change necessitate creative solutions that could fundamentally alter how businesses generate and utilize electricity. Industry researchers looking for ways to solve these problems have turned to data and new data-processing technology. Artificial intelligence, in particular — and

    3 MINUTES READ Continue Reading »

    About Us

    Incubated in Harvard Innovation Lab, Experfy specializes in pipelining and deploying the world's best AI and engineering talent at breakneck speed, with exceptional focus on quality and compliance. Enterprises and governments also leverage our award-winning SaaS platform to build their own customized future of work solutions such as talent clouds.

    Join Us At

    Contact Us

    1700 West Park Drive, Suite 190
    Westborough, MA 01581

    Email: [email protected]

    Toll Free: (844) EXPERFY or
    (844) 397-3739

    © 2025, Experfy Inc. All rights reserved.