Smoothing the time series
When we work with real-world data, we may often find noise, which is defined as pseudo-random fluctuations in values that don't belong to the observation data. In order to avoid or reduce this noise, we can use different approaches such as increasing the amount of data by the interpolation of new values where the series is sparse. However, in many cases this is not an option. Another approach is smoothing the series, typically using the average or exponential methods. The average method helps us to smooth the series by replacing each element in the series with either simple or weighted average of the data around it. We will define a Smoothing Window to the interval of possible values which control the smoothness of the result. The main disadvantage of using the moving averages approach is, if we have outliers or abrupt jumps in the original time series, the result may be inaccurate and can produce jagged curves.
In this chapter, we will implement a different approach...