Time series analysis is the process of using past data to predict future events. In this chapter we will learn different methods and when to apply these methods in order to make forecasts, which are predictions of future events.
Time series data can usually be broken down into three separate parts: the trend in time, the seasonal effect, and the irregular pattern. The general goal of time series is to decompose the time series into these three parts so we can see their effects individually. This is called the decomposition of time series. Once separated, we can then forecast on the individual parts separately. (James et al.)
The trend represents the general direction a time series takes over time. A time series trend could be either decreasing, increasing, or exhibit no trend.
The seasonal effect is a repeated fluctuation in our time series. Each repetition occurs at equal intervals away. For instance, yearly occurrence or monthly occurrence. This pattern can remain the same over time, or it can increase or decrease over time.
The irregular component is the last of the three main components that generally make up our time series data. It represents the remainder of the time series that was neither explained by the trend, nor the seasonal component. If the series displays no clear trends or patterns in the irregular component, then it is an indication that our trend and seasonal component captured the majority of the information from our model. If there is remaining patterns then this is an indication that we missed some important remaining component that makes up our time series data. (Frees, 2010)
A series can be either additive or multiplicative.
Additive: \(y_{t}=T_{t}+S_{t}+\epsilon_{t}\)
Multiplicative: \(y_{t}=T_{t}*S_{t}*\epsilon_{t}\)
A time series model is additive if the trend and seasonal component remain the same over time. A time series model is multiplicative if either the strength of the trend or seasonal component change over time. For instance, if there is an exponential growth in the trend then use a multiplicative model. In order to convert a multiplicative model to an additive model, simply take the log of both sides. (Frees, 2010)
If a series exhibits no trend, it can be represented by the model:
\(y_{t}=\beta_{0}+\epsilon_{t}\)
This would represent a series that is independently and identically distributed. An independently and identically distributed (i.i.d) series keeps the same mean and variance as each observation is random. An example would be flipping a coin.
A series with a linear trend can be represented by the model:
\(y_{t}=\beta_{0}+\beta_{1}t+\epsilon_{t}\)
Notice this takes a form very similar to linear regression. However, instead of using a predictor it multiplies a coefficient by the time. This can be extended to a quadratic trend using polynomial terms:
\(y_{t}=\beta_{0}+\beta_{1}t+\beta_{2}t^{2}+\epsilon_{t}\)
Seasonal trends can be represented with binary variables. For instance, if using a series with a monthly frequency, meaning the data is collected once a month, 12 levels would be added to our model, one for each month. They would be added in the same way as we would add a categorical variable in linear regression which is to add one of the months to the intercept as the baseline, and then add 11 coefficients for the other months.
Stationarity describes how a time series is impacted by time. If a series is stationary then we can say it is not affected by time. For the exam we are mainly focused on the concept of a series being weakly stationary. Weakly stationary means the expected values of the time series remains the same over time, and the variance remains the same over time. This means the expected value of \(y_{t}\) does not depend on time and the covariance between any two equal intervals of the series is the same.
In order to identify stationarity we can use control charts. In order to test if a series is weakly stationary the expected value of the mean and variance should remain the same over time.
In order to test if the mean remains constant over time we can use an Xbar chart. An Xbar charts splits the series into equal parts and takes the mean of each split. If the means exhibit some kind of trend or large differences it is evidence that the series is not stationary.
An R chart is used to test if the variability remains the same over time. The standard deviation is taken from successive samples just like how the mean is taken with the Xbar chart. The standard deviations should remain in the same range of values and exhibit no trend over time to be classified as weakly stationary.
The means should all fall within |\(\bar{y}-3_{s_{y}}\)|. The lower end of this interval is known as the lower control limit while the upper end is the upper control limit. (James et al.)
One way to model a weakly stationary series is to use a white noise process. White noise assumes observations are independently and identically distributed (i.i.d). This means there is no overall trends and the sample events are all independent. The forecasted value and standard deviation for any future observation is the same no matter how far away. This means the prediction interval will also remain the same over time. (James et al.)
Forecasted Values: \(\hat{y}_{t}=\bar{y}\)
Standard Errors: \(Se\hat{y}_{t}\)=\(s_{y}\sqrt{1+\frac{1}{n}}\)
Prediction Interval: \(\hat{y}\pm t_{a/2,df}*Se\hat{y}_{t}\)
Frees, E. W. (2010). Regression modeling with actuarial and financial applications. Cambridge University Press.
James, G., Witten, D., Hastie, T., & Tibshirani, R. (n.d.). An introduction to statistical learning: With applications in R.