'model weekly seasonality with fourier terms in python
I've hourly data and I want to model weekly seasonality with fourier terms. I'd like to implement it in pyhton.
I was trying in this way but I'm not sure about it.
exog = pd.DataFrame({'date': df.index})
exog = exog.set_index(df.index)
i = 4
for k in range(1, i):
exog['week_sin'+str(k)] = np.sin(2 *k* np.pi * exog.index.hour/168)
exog['week_cos'+str(k)] = np.cos(2 *k* np.pi * exog.index.hour/168)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
