当前位置:   article > 正文

ARIMA 时间序列1: 差分, ACF, PACF_arima acf pacf

arima 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 sns

sns.set(style = 'whitegrid', context = 'poster')
%matplotlib inline

Sentiment = pd.read_csv('sentiment.csv', index_col=0, parse_dates=[0])
Sentiment.head()
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

在这里插入图片描述

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.
  • 1
  • 2
  • 3
  • 4
  • 5
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号