Decomposing time series data
When performing time series analysis, one of your objectives may be forecasting, where you build a model to make a future prediction. Before starting the modeling process, you will need to extract the components of the time series process for analysis. This will help you make informed decisions during the modeling process. In addition, there are three major components for any time series process: trend, seasonality, and residual.
Trend gives a sense of the long-term direction of the time series and can be either upward, downward, or horizontal. For example, a time series of sales data can show an upward (increasing) trend. Seasonality is repeated patterns over time. For example, a time series of sales data might show an increase in sales around Christmas time. This phenomenon can be observed every year (annually) as we approach Christmas. The residual is simply the remaining or unexplained portion once we extract trend and seasonality.
The decomposition...