[英]multiple seasonality Time series analysis in Python
I have a daily time series dataset that I am using Python SARIMAX method to predict for future.我有一个每日时间序列数据集,我使用 Python SARIMAX 方法来预测未来。 But I do not know how to write codes in python that accounts for multiple seasonalities.
但我不知道如何在 python 中编写考虑多个季节性的代码。 As far as I know, SARIMAX takes care of only one seasonality but I want to check for weekly, monthly, and quarterly seasonalities.
据我所知,SARIMAX 只处理一个季节性,但我想检查每周、每月和每季度的季节性。 I know to capture day of the week seasonality, I should create 6 dummy variables, To capture day of the month seasonality, create 30 dummy variables, and To capture month of the year, create 11 dummy variables.
我知道要捕捉星期几的季节性,我应该创建 6 个虚拟变量,要捕捉月份的季节性,创建 30 个虚拟变量,并且要捕捉一年中的月份,创建 11 个虚拟变量。 But I don't know how to incorporate it with the main SARIMAX function in Python?
但我不知道如何将它与 Python 中的主要 SARIMAX 函数合并? I mean SARIMAX is just a function that does the autoregressive, moving average and the differencing parts but how should I include multiple seasonality codes in my time series analysis with SARIMAX?
我的意思是 SARIMAX 只是一个执行自回归、移动平均和差分部分的函数,但是我应该如何在使用 SARIMAX 的时间序列分析中包含多个季节性代码? So far, I know how to create dummy variables for each category but don't know how to replicate it to the entire dataset?
到目前为止,我知道如何为每个类别创建虚拟变量,但不知道如何将其复制到整个数据集? After that I don't know how to write Python codes that do SARIMAX and captures multiple seasonalities at the same time.
之后我不知道如何编写 Python 代码来执行 SARIMAX 并同时捕获多个季节性。
I am in need of help for Python code that can do it.我需要可以执行此操作的 Python 代码的帮助。
Please advise accordingly请相应地建议
Regards问候
Yes, SARIMA model is designed for dealing with a single seasonality.是的,SARIMA 模型是为处理单一季节性而设计的。
To make it work for multiple seasonality, it is possible to apply a method called Fourier terms.为了使其适用于多个季节性,可以应用一种称为傅立叶项的方法。
Secondly, there is a better method for time series data with multiple seasonality effects which is called TBABS.其次,对于具有多重季节性影响的时间序列数据,有一种更好的方法,称为 TBABS。 Here is an example that includes codes and explanation for both approaches: https://medium.com/intive-developers/forecasting-time-series-with-multiple-seasonalities-using-tbats-in-python-398a00ac0e8a
这是一个包含两种方法的代码和解释的示例: https : //medium.com/intive-developers/forecasting-time-series-with-multiple-seasonalities-using-tbats-in-python-398a00ac0e8a
Thirdly, you can check https://facebook.github.io/prophet/ which also brings up an easier way to this issue.第三,您可以查看https://facebook.github.io/prophet/ ,这也为解决此问题提供了更简单的方法。
For a deeper research, you can always google terms "time series" with "multiple seasonality" or "multiple seasonal effect"要进行更深入的研究,您始终可以使用“多季节性”或“多季节性效应”在谷歌上搜索“时间序列”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.