详细内容或原文请订阅后点击阅览
如何在时间序列中查找季节性模式
使用傅里叶变换检测季节性成分文章“如何在时间序列中查找季节性模式”首先出现在 Towards Data Science 上。
来源:走向数据科学在我作为数据科学家的职业生涯中,我多次遇到时间序列。我的大部分知识来自我的学术经历,特别是我的计量经济学课程(我拥有经济学学位),我们在那里研究了时间序列的统计特性和模型。
我研究的模型之一是 SARIMA,它承认时间序列的季节性,但是,我们从未研究过如何拦截和识别季节性模式。
SARIMA 季节性大多数时候,我必须找到季节性模式,我只是依靠对数据的视觉检查。直到我偶然发现了这个关于傅里叶变换的 YouTube 视频,并最终发现了周期图是什么。
视觉 检查 这个 YouTube 视频 傅里叶变换 周期图在这篇博文中,我将解释和应用简单的概念,这些概念将成为每个研究时间序列的 DS 都应该知道的有用工具。
目录
目录- 什么是傅里叶变换?Python 中的傅里叶变换周期图
概述
假设我有以下数据集(AEP 能耗,CC0 许可证):
AEP 能耗import pandas as pdimport matplotlib.pyplot as pltdf = pd.read_csv("data/AEP_hourly.csv", index_col=0) df.index = pd.to_datetime(df.index)df.sort_index(inplace=True)fig, ax = plt.subplots(figsize=(20,4))df.plot(ax=ax)plt.tight_layout()plt.show()
import pandas as pdimport matplotlib.pyplot as pltdf = pd.read_csv("data/AEP_hourly.csv", index_col=0) df.index = pd.to_datetime(df.index)df.sort_index(inplace=True)fig, ax = plt.subplots(figsize=(20,4))df.plot(ax=ax)plt.tight_layout()plt.show()
导入
作为
导入
.
作为
=
.
(
"data/AEP_hourly.csv"
,
=
0
)
.
=
。
(
。
)
。
(
=
正确
)
,
=
。
(
=
(
20
,
4
)
)
。
(
=
)
.
(
)
.
(
)
仅从目视检查来看,很明显季节性模式正在发挥作用,但是拦截它们可能很容易。
手动 , = . ( 3 , 1 , =