Time Series Analysis and Forecasting Definition and Examples

What is a time series? How do you make a forecast? In this short post we’ll talk about the components of time series and forecasting. Don’t worry; even though this topic can seem complex at first, we’ll just keep it to the basics for now.

time series and forecasting

The blue curve represents known data. Forecasted data is represented in orange (lighter orange curves give the bounds of the confidence intervals).

Time Series Definitions

A times series is a set of data recorded at regular times. For example, you might record the outdoor temperature at noon every day for a year.

The movement of the data over time may be due to many independent factors.

  • Long term trend: the overall movement or general direction of the data, ignoring any short term effects such as cyclical or seasonal variations. For example, the enrollment trend at a particular university may be a steady climb on average over the past 100 years. This trend may be present despite having a few years of loss or stagnant enrollment followed by years of rapid growth.
  • Cyclical Movements: Relatively long term patterns of oscillation in the data. These cycles may take many years to play out. There is a various cycles in business economics, some taking 6 years, others taking half a century or more.
  • Seasonal Variation: Predictable patterns of ups and downs that occur within a single year and repeat year after year. Temperatures typically show seasonal variation, dropping in the Fall and Winter and rising again in the Spring and Summer.
  • Noise: Every set of data has noise. These are random fluctuations or variations due to uncontrolled factors.

Putting the Factors Together

Each factor has an associated data series:

  • Trend factor: Tt
  • Cyclic factor: Ct
  • Seasonal factor: St
  • Noise factor: Nt

Finally, the original data series, Yt, consists of the product of the individual factors.

Yt = Tt × Ct × St × Nt

Often only one of the oscillating factors, Ct or St, is needed.

There are precise mathematical methods for teasing apart the individual factors from a given time series, but that’s a topic for another day!

Forecasting

The idea behind forecasting is to predict future values of data based on what happened before. It’s not a perfect science, because there are typically many factors outside of our control which could affect the future values substantially. The further into the future you want to forecast, the less certain you can be of your prediction.

Just look at weather reporting! Figuring out if it will rain tomorrow is not too difficult, but it’s virtually impossible to predict if it will rain exactly a month from now.

Humber Lifeboat Station Weather Forecasting Stone

Humber Lifeboat Station Weather Forecasting Stone (photo by Nelo Hotsuma).

Basically, the theory behind a forecast is as follows.

  1. Smooth out all of the cyclical, seasonal, and noise components so that only the overall trend remains.
  2. Find an appropriate regression model for the trend. Simple linear regression often does the trick nicely. (Check out Introduction to Regression Analysis for more on that topic.)
  3. Estimate the cyclical and seasonal variations of the original data.
  4. Factor the cyclical and seasonal variations back into the regression model.
  5. Obtain estimates of error (confidence intervals). The larger the noise factor, the less certain the forecasted data will be.

Most statistical software can perform a time series forecast. Even Excel has this feature — see Understanding Time Series Forecasting in Excel, for example.

Summary

Forecasting time series data allows you to make predictions of future events. While the theory and methods can be a bit complicated, the basic idea is to extend the underlying trend together with the predictable ups and downs already present in the data.