Time Series Forecasting has applications in many disciplines. From business and finance to public health, meteorology, and other scientific fields, the target of the analysis often depends on time. As the first of three blogs, this blog will be an introduction to time series forecasting.
It’s important to understand the fundamentals of time series forecasting before getting into any specifics. First, when taking on any analysis, we assume that some relationship between our predictor(s) and target exists. When considering the use of classical models on time series data without exogenous variables, this assumption determines whether we can build a good model, since it is entirely based on time. The other important factors to cover are:
These different attributes of time series are useful in deciding which models to try. Often, we need to deal with multiple attributes, and cases in which data exemplifies nearly perfect trend, seasonality, and cyclicality are exceedingly rare. Like any forecast, the challenge of uncertainty exists because we are estimating the true model and do not know what the future looks like.
Trends are typical in a business setting and help show and predict change over time. For a product gaining attention via advertising, this trend could be increasing, while one outshone by a newer model could see a decreasing trend. Trend is a main factor in many time series models.
Seasonality exists when patterns occur over repeating and fixed time intervals. Weekly and yearly seasonality are common, while seasonality can possibly be observed for any fixed interval of time. In business, sales often show seasonality due to products having higher demand during different times of the year. It is worth noting that multiple seasonality’s can exist, where—for example—our target may show a pattern over a week and another pattern over the fiscal quarter.
Cyclicality also deals with patterns in time series, though the length of a “cycle” is not known and usually changes from cycle to cycle. While seasonality is usually no longer than a year, cyclicality tends to extend over multiple years/seasons.
The forecast horizon is simply the range over which we make our predictions. Forecasting is an estimation of future observations and uncertainty over the forecast horizon changes. Typically, uncertainty grows the further out our forecast goes, which is a reason for introducing confidence or prediction intervals to show this increase. Intuitively, we’re usually more certain of what something will do tomorrow than in a year. The length of future observations also requires sufficient historical data. Some models require more observations to learn the nature of the data, while some may only use a small range.
Irregularities in historical data can throw off a forecast. Domain knowledge is necessary for confirming and understanding drastic changes or anomalies. Two examples of this are the COVID-19 pandemic and errors in data entry. It is worth noting that economic shifts and incorrectly recorded data are not comprehensive in understanding anomalous behavior, and are just two of many possible explanations. The economic changes directly following the announcements of COVID-19 affected most industries due to supply issues, less spending, and spending more time at home. Electricity usage in many business offices fell, subscriptions for web services grew, and sales of normal goods dropped. Domain knowledge is important since an inadequate understanding of why historical data changed could lead to unrealistic forecasts that have been trained on anomalous observations. This applies to incorrect data, as an outlier in any context should be understood to avoid making poor assumptions.
Stationarity is a requirement for some but not all time series models. A time series is essentially stationary when the distribution of the observations does not depend on time, meaning no trend or seasonality is present, and the mean and variance are constant. This will often require us to make non-stationary time series stationary.
Exponential Smoothing (ETS): ETS models are suited for data with trends and seasonal patterns. They apply smoothing weights to components, providing a flexible approach to forecasting. Depending on whether there is a trend and/or seasonality, different exponential smoothing models are used.
Autoregressive Integrated Moving Average (ARIMA): These models are ideal for a variety of time series. They are made up of autoregressive and moving average components and use differencing to ensure stationarity.
Long Short-Term Memory (LSTM) Networks: Part of the deep learning family, LSTMs are designed to remember long-term dependencies, making them perfect for complex, sequential data patterns.
Each of these models has its use case, advantages, and limitations. A detailed exploration of these models will be the subject of a future blog post, where we’ll delve into how to select and apply these models effectively in different scenarios.
Data Quality: Time series data often suffers from missing values, outliers, or noise that can significantly impact forecast accuracy.
Seasonality and Trend Adjustments: Accounting for seasonal patterns and trends over time can be complex, particularly with data that evolves.
Model Selection: Choosing the right forecasting model can be challenging given the vast array of options, each with its strengths and weaknesses. This is especially true when considering more modern machine learning methods alongside classical ones, as one is not always better than the other.
Data Preprocessing: Employ techniques like interpolation for missing data, outlier detection and removal, and smoothing methods to reduce noise.
Decomposition: Use time series decomposition to separately model and forecast the trend, seasonal, and residual components.
Model Evaluation: Implement cross-validation and use metrics such as MAE, RMSE, and AIC to assess model performance and select the best model for the specific time series.
Time series forecasting is a powerful tool used on temporal data. As we’ve explored the fundamentals, challenges, and a few models associated with forecasting, it’s clear that there are many applications for which we can choose from multiple options depending on the given data. Whether predicting stock market trends, forecasting climate, or planning inventory levels, time series forecasting remains an essential component of strategic decision-making processes in various domains.
Following this blog, we will explore classical time series models in the univariate case.
Discover how our expertise can drive innovation and efficiency in your projects. Whether you’re looking to harness the power of AI, streamline software development, or transform your data into actionable insights, our tailored demos will showcase the potential of our solutions and services to meet your unique needs.
Connect with our team today by filling out your project information.
802 N. Pinyon Ct,
Hartland, WI 53029
(866) 568-8615
info@xorbix.com