Rolling Window in Time Series
@time_series @smoothing
Important concept in time series.
One of the most basic forecasting methods is the moving average, but this only allows you to make a prediction one step ahead since you have to observe all previous data.
You can however also use the moving average to smoothen out time series with the purpose of identifying trends.
The wider the time window, the more you will smoothen out the series.
This is called a rolling mean.
With pandas: Dataframe.rolling(window).mean()
This is also useful for detecting anomalies w.r.t. the identified trend. What will be marked as an anomaly is however strongly influenced by your window size and what trend it captures (e.g. daily, weekly, monthly etc.). This method is obviously limited.