The considered gold prices do not contain obvious seasonality. However, if the dataset shows seasonal patterns, there are a few potential solutions:
- Adjustment by differencing: Instead of using the first order differencing, use a higher-order one, for example, if there is yearly seasonality in monthly data, use diff(12).
- Adjustment by modeling: We can directly model the seasonality and then remove it from the series. One possibility is to extract the seasonal component from seasonal_decompose or another more advanced automatic decomposition algorithm. In this case, we should subtract the seasonal component when using the additive model or divide by it if the model is multiplicative. Another solution is to use np.polyfit() ...