季节性ARIMA模型进行时间序列预测

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

首先对于模型: 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值