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 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:
*T*_{t} - Cyclic factor:
*C*_{t} - Seasonal factor:
*S*_{t} - Noise factor:
*N*_{t}

Finally, the original data series, *Y _{t}*, consists of the product of the individual factors.

*Y _{t}* =

*T*×

_{t}*C*×

_{t}*S*×

_{t}*N*

_{t}Often only one of the oscillating factors, *C _{t}* or

*S*, is needed.

_{t}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.

Basically, the theory behind a forecast is as follows.

- Smooth out all of the cyclical, seasonal, and noise components so that only the overall trend remains.
- 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.)
- Estimate the cyclical and seasonal variations of the original data.
- Factor the cyclical and seasonal variations back into the regression model.
- 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.

Pls how do we forecast in state space model

Hi! That is an excellent question, which unfortunately falls outside the scope of this article.