Seasonal Decompose
To calculate the prediction bounds, refer to the STL Decomposition.ipynb notebook, where we can investigate the option of adding the mean and the standard deviations of the residuals into the trend and seasonal components.
Calculating the lower band
lower = avg_over_time((mean_over_time(Residuals[5m:])-$Bound*stddev_over_time(Residuals[5m:]))[5m:]) + Trend + Seasonal Component
python
Calculating the upper band
upper = avg_over_time((mean_over_time(Residuals[5m:])+$Bound*stddev_over_time(Residuals[5m:]))[5m:]) + Trend + Seasonal Component
python
For an in-depth discussion of the SARIMA functions, see these external resources:
-
Documentation for statsmodels.tsa.seasonal.seasonal_decompose
-
Decomposition of time series in Wikipedia
-
Time-Series-Analysis /STL Decomposition.ipynb GitHub repository