首先对于模型: SARIMA(p,d,q)x(P,D,Q)。
参数的选择的注意事项如下:
where, P, D and Q are SAR, order of seasonal differencing and SMA terms respectively and ‘x’ is the frequency of the time series. If the model has well defined seasonal patterns, then enforce D=1 for a given frequency ‘x’.
We should set the model parameters such that D never exceeds one. And the total differencing ‘d + D’ never exceeds 2. We should try to keep only either SAR or SMA terms if the model has seasonal components.
代码如下:
# 导入必要的包
import matplotlib.pyplot as plt
import pandas as pd
# 数据读入
time_series_table=pd.read_csv('new_merged.csv',index_col=0,parse_dates=True)
time_series_table=time_series_table.sort_index()
print(time_series_table)

from statsmodels.tsa.statespace.sarimax import SARIMAX
# 季节模型的拟合
best_model = SARIMAX(time_series_table['33_1002'][:-432], order=(0, 0, 2), seasonal_order=(0, 1, 2

本文介绍了SARIMA模型在时间序列分析中的应用,重点讲解了季节性参数的选择、季节差分的重要性以及模型拟合后的残差检查。作者提到季节SARIMAX不适用于大周期,例如144,可能导致拟合速度慢和内存消耗大。
最低0.47元/天 解锁文章
755

被折叠的 条评论
为什么被折叠?



