# Time Series Forecasting

Time series analysis is a statistical technique economists, researchers, and other analysts use to model and subsequently forecast data, or moreover, other times series, where times are discrete (t=1,2,3…n) or continuous (t>0). It is most useful on large data sets, and consists of three primary components, including seasonality, trend, and random irregularity—or noise. A simple example of a time series, without any analyses, is depicted in the figure below:

But in and of itself, this series tells us little; it merely depicts unemployment rates from January 2011, through September 2016, in Beaufort County, South Carolina. However, given what appears to be a definitive trend, potential seasonality, and obvious noise we can use these data to project, or forecast, another time series, using time series analysis; and this may be of some value. For example, had we previously determined that unemployment rate had a statistical effect on say, sales, we may want to gain a better understanding of unemployment—where it has been, and where it is going. To understand such, we must model these data, or in lay terms, we must develop a simple set of mathematical equations to forecast unemployment rate, say from October 2016 through December 2017.

Before becoming too involved in our actual model, however, we need to calculate a moving average for these data to allow us to gain a snapshot in time using subseries of our total series. To do so, we first calculate a simple moving average, weighted moving average, or exponential moving average. There are arguments for and against these type averages, but for our case we will use a simple moving average, and more specifically, a centered moving average because we have an even number of observations (n=68). In calculating a centered moving average, we effectively smooth our data by removing the seasonal component and noise in our data. Refer to the figure below to review our series after we have added a centered moving average using 12 cycles.

After calculating a moving average and plotting it, we must run a few simple calculations to develop our model; but let me first digress to discuss seasonality. The term seasonality should not be confused to imply the four meteorological seasons as earth rotates the sun. While such may in fact be the case, when we use the term seasonality, think in terms of our data being periods, or cyclical in that our variable unemployment rate moves similarly in some form of a cyclical basis.

Now that we have our moving average, we can consider how much of our unemployment rate was due to seasonality (St) and how much was due to irregularity, or noise (It). In brief, our unemployment rate (Yt) divided by our centered moving average (CMA) calculates these components (St, It) combined. Now, we can consider the seasonality component (St) itself by isolating it from the irregularity component (It), which can be determined by average St,It for each of our 12 cycles, or in our case, months, year over year. Next, knowing the seasonal component, we deseasonalize our variable unemployment rate by dividing unemployment rate, Yt by the seasonal component, St.

We next must decide how to calculate our trend component, Tt. There are different methods of doing so, depending upon the data, but in our case we will use linear regression, with year as our independent variable (t=1, 2, 3….68) and our deseasonalized component as our dependent variable. Based upon our calculated intercept and slope coefficients, and assuming they are statistically significant, we then calculate our trend variable, Tt. Finally, knowing our seasonal component we can multiply our trend component, Tt, by the seasonal component, St, to project unemployment rate through December 2017. Then, of course, we can develop other models that leverage unemployment against sales. Refer to the figure below to review the completed projected data.