I have to computer the seasonality, but my graph gives me the wrong result. The seasonality in this dataset is quarterly (frequency of 4 months) and with an amplitude of 1.2. I would appreciate and be extremely thankful for any help!
import numpy as np
x_axis = np.arange(0, 200)
seasonality = np.zeros(len(x_axis))
for i, _ in enumerate(x_axis):
seasonality[i] = 1.2 * np.sin(2 * np.pi * x_axis[i] / 4)
plt.figure(figsize=(14,5))
plt.plot(x_axis[0:13], seasonality[0:13])
This code was used by the professor so it is correct. But the example he used was different. Maybe it is the period that is incorrect.
CodePudding user response: