statsmodelsで季節成分分解
季節成分の抽出
import statsmodels.api as sm res = sm.tsa.seasonal_decompose(X, freq=16) #トレンド成分 trend = res.trend #季節成分 season = res.seasonal #図示 fig = plt.figure(figsize=(16,8)) ax = fig.add_subplot(111) ax.plot(trend, label='trend') ax2 = ax.twinx() ax2.plot(season, c='orange', label='season') plt.legend() plt.show()