本文主要是介绍ARIMA 时间序列1: 差分, ACF, PACF,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
ARIMA
ARIMA(p,d,q)模型全称为差分自回归移动平均模型
(Autoregressive Integrated Moving Average Model,简记ARIMA).
自回归(AR),差分(I),移动平均(MA)
趋势参数:
- p:趋势自回归阶数。
- d:趋势差分阶数。
- q:趋势移动平均阶数。
ACF 与 PACF
自相关函数 ACF (autocorrelation function)
偏自相关函数 PACF (partial autocorrelation function)
- 自相关函数ACF 还包含了其他变量的影响
- 偏自相关系数PACF 是严格这两个变量之间的相关性
- ARIMA(p,d,q)阶数确定:
- AR (p ) 看PACF
MA(q ) 看ACF
实例: 美国消费者信心指数
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as snssns.set(style = 'whitegrid', context = 'poster')
%matplotlib inlineSentiment = pd.read_csv('sentiment.csv', index_col=0, parse_dates=[0])
Sentiment.head()
sns.set(style = 'ticks', context = 'poster')sentiment_select = Sentiment.loc['2004' : '2016']
sentiment_select.plot(figsize = (12, 8))
plt.legend(bbox_to_anchor = (1.25, 0.5))
plt.
这篇关于ARIMA 时间序列1: 差分, ACF, PACF的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!