时间序列模型---基本性质判断及相关计算
前言
一、常用时间序列模型
Prerequisite
 时间序列:
    
     
      
       
        {
       
       
        
         x
        
        
         t
        
       
       
        }
       
      
      
       \left\{ x_t \right\}
      
     
    {xt}
 白噪声(white noise):
    
     
      
       
        
         w
        
        
         t
        
       
      
      
       w_t
      
     
    wt 
     
      
       
        
         
          w
         
         
          t
         
        
        
         ∼
        
        
         
          w
         
         
          n
         
         
          (
         
         
          0
         
         
          ,
         
         
          
           σ
          
          
           w
          
          
           2
          
         
        
        
         )
        
       
       
        w_t \sim {wn(0,\sigma_w^2})
       
      
     wt∼wn(0,σw2) 后移算子(Backshift operator): 
    
     
      
       
        B
       
      
      
       B
      
     
    B 
     
      
       
        
         
          x
         
         
          
           t
          
          
           −
          
          
           1
          
         
        
        
         =
        
        
         B
        
        
         
          x
         
         
          t
         
        
        
        
         
          x
         
         
          
           t
          
          
           −
          
          
           p
          
         
        
        
         =
        
        
         
          B
         
         
          p
         
        
        
         
          x
         
         
          t
         
        
       
       
        x_{t-1}=Bx_t \\ x_{t-p}=B^px_t
       
      
     xt−1=Bxtxt−p=Bpxt 差分算子(Difference operator): 
    
     
      
       
        ∇
       
      
      
       \nabla
      
     
    ∇ 
     
      
       
        
         ∇
        
        
         
          x
         
         
          t
         
        
        
         =
        
        
         
          x
         
         
          t
         
        
        
         −
        
        
         
          x
         
         
          
           t
          
          
           −
          
          
           1
          
         
        
        
         =
        
        
         (
        
        
         1
        
        
         −
        
        
         B
        
        
         )
        
        
         
          x
         
         
          t
         
        
       
       
        \nabla x_t=x_t-x_{t-1}=(1-B)x_t
       
      
     ∇xt=xt−xt−1=(1−B)xt d阶差分(Differenc of order d)
     
      
       
        
         
          ∇
         
         
          d
         
        
        
         =
        
        
         (
        
        
         1
        
        
         −
        
        
         B
        
        
         
          )
         
         
          d
         
        
       
       
        \nabla^d=(1-B)^d
       
      
     ∇d=(1−B)d
1.自回归模型 —AR( p p p)
x t = ϕ 1 x t − 1 + ϕ 2 x t − 2 + . . . + ϕ p x t − p + w t , w t ∼ w n ( 0 , σ w 2 ) x_t=\phi_1x_{t-1}+\phi _2x_{t-2}+...+\phi _px_{t-p}+w_t, w_t\sim wn(0,\sigma_w^2) xt=ϕ1xt−1+ϕ2xt−2+...+ϕpxt−p+wt,wt∼wn(0,σw2) ϕ ( B ) = 1 − ϕ 1 B − ϕ 2 B 2 − . . . − ϕ p B p \phi(B)=1-\phi_1B-\phi_2B^2-...-\phi_pB^p ϕ(B)=1−ϕ1B−ϕ2B2−...−ϕpBp ϕ ( B ) x t = w t \phi(B)x_t=w_t ϕ(B)xt=wt
1.1 参数p的确定
①若已知时间序列过程表达式 
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt,则根据表达式 
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt中p的数值确定。
 ②若有一组时间序列数据,则画出其PACF图,PACF在滞后数为p的地方截尾,即PACF在 lag=p 处之后在2个标准差内。
1.2 平稳性判断(stationary)
将 
    
     
      
       
        ϕ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \phi(B)
      
     
    ϕ(B)写成 
    
     
      
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \phi(z)
      
     
    ϕ(z),则有
     
      
       
        
         ϕ
        
        
         (
        
        
         z
        
        
         )
        
        
         =
        
        
         1
        
        
         −
        
        
         
          ϕ
         
         
          1
         
        
        
         z
        
        
         −
        
        
         
          ϕ
         
         
          2
         
        
        
         
          z
         
         
          2
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
         −
        
        
         
          ϕ
         
         
          p
         
        
        
         
          z
         
         
          p
         
        
       
       
        \phi(z)=1-\phi_1z-\phi_2z^2-...-\phi_pz^p
       
      
     ϕ(z)=1−ϕ1z−ϕ2z2−...−ϕpzp 若具有平稳性,则 
    
     
      
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \phi(z)
      
     
    ϕ(z)的根不在单位圆上
 令 
    
     
      
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
       
        =
       
       
        0
       
      
      
       \phi(z)=0
      
     
    ϕ(z)=0,并求解。 
    
     
      
       
        ∣
       
       
        z
       
       
        ∣
       
       
        ≠
       
       
        1
       
       
        ⟺
       
      
      
       \lvert z\lvert\neq1\Longleftrightarrow
      
     
    ∣z∣=1⟺ 具有平稳性(stationary)
1.3 因果性判断(causal)
若具有因果性,则 
    
     
      
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \phi(z)
      
     
    ϕ(z)的根在单位圆外
 令 
    
     
      
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
       
        =
       
       
        0
       
      
      
       \phi(z)=0
      
     
    ϕ(z)=0,并求解。 
    
     
      
       
        ∣
       
       
        z
       
       
        ∣
       
       
        >
       
       
        1
       
       
        ⟺
       
      
      
       \lvert z\lvert>1\Longleftrightarrow
      
     
    ∣z∣>1⟺ 具有因果性(causal) 
     
      
       
        
       
      
     
2. 移动平均模型 —MA(q)
x t = w t + θ 1 w t − 1 + θ 2 w t − 2 + . . . + θ q w t − q , w t ∼ w n ( 0 , σ w 2 ) x_t=w_t+\theta_1w_{t-1}+\theta _2w_{t-2}+...+\theta _qw_{t-q}, w_t\sim wn(0,\sigma_w^2) xt=wt+θ1wt−1+θ2wt−2+...+θqwt−q,wt∼wn(0,σw2) θ ( B ) = 1 + θ 1 B + θ 2 B 2 + . . . + θ q B q \theta(B)=1+\theta_1B+\theta_2B^2+...+\theta_qB^q θ(B)=1+θ1B+θ2B2+...+θqBq x t = θ ( B ) w t x_t=\theta(B)w_t xt=θ(B)wt
2.1 参数q的确定
①若已知时间序列过程表达式 
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt,则根据表达式 
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt中q的数值确定。
 ②若有一组时间序列数据,则画出其ACF图,ACF在滞后数为p的地方截尾,即ACF在 lag=q 处之后在2个标准差内。
2.2 平稳性判断(stationary)
对于移动平均模型,总是平稳的。
2.3 可逆性判断(invertible)
将 
    
     
      
       
        θ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \theta(B)
      
     
    θ(B)写成 
    
     
      
       
        θ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \theta(z)
      
     
    θ(z),则有
     
      
       
        
         θ
        
        
         (
        
        
         z
        
        
         )
        
        
         =
        
        
         1
        
        
         +
        
        
         
          θ
         
         
          1
         
        
        
         z
        
        
         +
        
        
         
          θ
         
         
          2
         
        
        
         
          z
         
         
          2
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         +
        
        
         
          θ
         
         
          q
         
        
        
         
          z
         
         
          q
         
        
       
       
        \theta(z)=1+\theta_1z+\theta_2z^2+...+\theta_qz^q
       
      
     θ(z)=1+θ1z+θ2z2+...+θqzq 若具有可逆性性,则 
    
     
      
       
        θ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \theta(z)
      
     
    θ(z)的根在单位圆外
 令 
    
     
      
       
        θ
       
       
        (
       
       
        z
       
       
        )
       
       
        =
       
       
        0
       
      
      
       \theta(z)=0
      
     
    θ(z)=0,并求解。 
    
     
      
       
        ∣
       
       
        z
       
       
        ∣
       
       
        >
       
       
        1
       
       
        ⟺
       
      
      
       \lvert z\lvert>1\Longleftrightarrow
      
     
    ∣z∣>1⟺ 具有可逆性(invertible) 
     
      
       
        
       
      
     
3. 自回归移动平均模型 —ARMA(p,q)
x t − ϕ 1 x t − 1 − ϕ 2 x t − 2 − . . . − ϕ p x t − p = w t + θ 1 w t − 1 + θ 2 w t − 2 + . . . + θ q w t − q , w t ∼ w n ( 0 , σ w 2 ) x_t-\phi_1x_{t-1}-\phi _2x_{t-2}-...-\phi _px_{t-p}=w_t+\theta_1w_{t-1}+\theta _2w_{t-2}+...+\theta _qw_{t-q}, w_t\sim wn(0,\sigma_w^2) xt−ϕ1xt−1−ϕ2xt−2−...−ϕpxt−p=wt+θ1wt−1+θ2wt−2+...+θqwt−q,wt∼wn(0,σw2) ϕ ( B ) x t = θ ( B ) w t \phi(B)x_t=\theta(B)w_t ϕ(B)xt=θ(B)wt
3.1 p,q
①根据 
    
     
      
       
        ϕ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \phi(B)
      
     
    ϕ(B)和 
    
     
      
       
        θ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \theta(B)
      
     
    θ(B)的阶数确定ARMA(p,q)
 避免参数冗余(redundancy)
 确定 
    
     
      
       
        ϕ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \phi(B)
      
     
    ϕ(B)和 
    
     
      
       
        θ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \theta(B)
      
     
    θ(B)的阶数时,两个表达式不能有相同的因子,即两个特征方程不能有相同的根。
    
     
      
       
        ϕ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \phi(B)
      
     
    ϕ(B)和 
    
     
      
       
        θ
       
       
        (
       
       
        B
       
       
        )
       
      
      
       \theta(B)
      
     
    θ(B)有相同因子则模型表达式存在参数冗余。
 ②根据ACF图和PACF图酌情选择
3.2 稳定性,因果性,可逆性
ϕ ( z ) = 0 ⟹ { ∣ z ∣ ≠ 1 ⟺ 具 有 平 稳 性 ( s t a t i o n a r y ) ∣ z ∣ > 1 ⟺ 具 有 因 果 性 ( c a u s a l ) \phi(z)=0 \Longrightarrow \left\{ \begin{matrix} \lvert z\lvert\neq1\Longleftrightarrow具有平稳性(stationary)\\\lvert z\lvert>1\Longleftrightarrow具有因果性(causal) \end{matrix}\right. ϕ(z)=0⟹{∣z∣=1⟺具有平稳性(stationary)∣z∣>1⟺具有因果性(causal) θ ( z ) = 0 ⟹ ∣ z ∣ > 1 ⟺ 具 有 可 逆 性 ( i n v e r t i b l e ) \theta(z)=0 \Longrightarrow\lvert z\lvert>1\Longleftrightarrow 具有可逆性(invertible) θ(z)=0⟹∣z∣>1⟺具有可逆性(invertible)
3.3 转换系数 ψ , π \psi,\pi ψ,π
①对于具有因果性的模型,可计算 
     
      
       
        
         ψ
        
       
       
        \psi
       
      
     ψ 
     
      
       
        
         
          x
         
         
          t
         
        
        
         =
        
        
         
          ∑
         
         
          
           j
          
          
           =
          
          
           0
          
         
         
          ∞
         
        
        
         
          ψ
         
         
          j
         
        
        
         
          w
         
         
          
           t
          
          
           −
          
          
           j
          
         
        
        
         ,
        
        
         ψ
        
        
         (
        
        
         B
        
        
         )
        
        
         =
        
        
         
          ψ
         
         
          0
         
        
        
         +
        
        
         
          ψ
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          ψ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
        
         
          {
         
         
          
           
            
             
              
               ϕ
              
              
               (
              
              
               B
              
              
               )
              
              
               
                x
               
               
                t
               
              
              
               =
              
              
               θ
              
              
               (
              
              
               B
              
              
               )
              
              
               
                w
               
               
                t
               
              
             
            
           
          
          
           
            
             
              
               
                x
               
               
                t
               
              
              
               =
              
              
               ψ
              
              
               (
              
              
               B
              
              
               )
              
              
               
                w
               
               
                t
               
              
             
            
           
          
         
        
        
         ⟹
        
        
         ϕ
        
        
         (
        
        
         B
        
        
         )
        
        
         ψ
        
        
         (
        
        
         B
        
        
         )
        
        
         =
        
        
         θ
        
        
         (
        
        
         B
        
        
         )
        
       
       
        x_t=\sum_{j=0}^{\infty}\psi_jw_{t-j} , \psi(B)=\psi_0+\psi_1B+\psi_2B^2-... \\ \left\{\begin{matrix} \phi(B)x_t=\theta(B)w_t \\ x_t=\psi(B)w_t \end{matrix}\right.\Longrightarrow \phi(B)\psi(B)=\theta(B)
       
      
     xt=j=0∑∞ψjwt−j,ψ(B)=ψ0+ψ1B+ψ2B2−...{ϕ(B)xt=θ(B)wtxt=ψ(B)wt⟹ϕ(B)ψ(B)=θ(B) 
     
      
       
        
         (
        
        
         1
        
        
         −
        
        
         
          ϕ
         
         
          1
         
        
        
         B
        
        
         −
        
        
         
          ϕ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
        
         (
        
        
         
          ψ
         
         
          0
         
        
        
         +
        
        
         
          ψ
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          ψ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
        
         =
        
        
         (
        
        
         1
        
        
         +
        
        
         
          θ
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          θ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
       
       
        (1-\phi_1B-\phi_2B^2-...)(\psi_0+\psi_1B+\psi_2B^2+...)=(1+\theta_1B+\theta_2B^2+...)
       
      
     (1−ϕ1B−ϕ2B2−...)(ψ0+ψ1B+ψ2B2+...)=(1+θ1B+θ2B2+...) 根据不同阶B前面的系数,可以写出 
    
     
      
       
        ϕ
       
       
        ,
       
       
        ψ
       
      
      
       \phi,\psi
      
     
    ϕ,ψ和 
    
     
      
       
        θ
       
      
      
       \theta
      
     
    θ 的等式,进而求出系数 
    
     
      
       
        ψ
       
      
      
       \psi
      
     
    ψ。
 ②对于具有可逆性的模型,可计算 
     
      
       
        
         π
        
       
       
        \pi
       
      
     π 
     
      
       
        
         
          w
         
         
          t
         
        
        
         =
        
        
         
          ∑
         
         
          
           j
          
          
           =
          
          
           0
          
         
         
          ∞
         
        
        
         
          π
         
         
          j
         
        
        
         
          x
         
         
          
           t
          
          
           −
          
          
           j
          
         
        
        
         ,
        
        
         π
        
        
         (
        
        
         B
        
        
         )
        
        
         =
        
        
         
          π
         
         
          0
         
        
        
         +
        
        
         
          π
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          π
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
        
         
          {
         
         
          
           
            
             
              
               ϕ
              
              
               (
              
              
               B
              
              
               )
              
              
               
                x
               
               
                t
               
              
              
               =
              
              
               θ
              
              
               (
              
              
               B
              
              
               )
              
              
               
                w
               
               
                t
               
              
             
            
           
          
          
           
            
             
              
               
                w
               
               
                t
               
              
              
               =
              
              
               π
              
              
               (
              
              
               B
              
              
               )
              
              
               
                x
               
               
                t
               
              
             
            
           
          
         
        
        
         ⟹
        
        
         ϕ
        
        
         (
        
        
         B
        
        
         )
        
        
         =
        
        
         π
        
        
         (
        
        
         B
        
        
         )
        
        
         θ
        
        
         (
        
        
         B
        
        
         )
        
       
       
        w_t=\sum_{j=0}^{\infty}\pi_jx_{t-j} , \pi(B)=\pi_0+\pi_1B+\pi_2B^2-... \\ \left\{\begin{matrix} \phi(B)x_t=\theta(B)w_t \\ w_t=\pi(B)x_t \end{matrix}\right. \Longrightarrow\phi(B)=\pi(B)\theta(B)
       
      
     wt=j=0∑∞πjxt−j,π(B)=π0+π1B+π2B2−...{ϕ(B)xt=θ(B)wtwt=π(B)xt⟹ϕ(B)=π(B)θ(B) 
     
      
       
        
         (
        
        
         1
        
        
         −
        
        
         
          ϕ
         
         
          1
         
        
        
         B
        
        
         −
        
        
         
          ϕ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
        
         =
        
        
         (
        
        
         1
        
        
         +
        
        
         
          θ
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          θ
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
        
         (
        
        
         
          π
         
         
          0
         
        
        
         +
        
        
         
          π
         
         
          1
         
        
        
         B
        
        
         +
        
        
         
          π
         
         
          2
         
        
        
         
          B
         
         
          2
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         )
        
       
       
        (1-\phi_1B-\phi_2B^2-...)=(1+\theta_1B+\theta_2B^2+...)(\pi_0+\pi_1B+\pi_2B^2+...)
       
      
     (1−ϕ1B−ϕ2B2−...)=(1+θ1B+θ2B2+...)(π0+π1B+π2B2+...) 根据不同阶B前面的系数,可以写出 
    
     
      
       
        ϕ
       
       
        ,
       
       
        π
       
      
      
       \phi,\pi
      
     
    ϕ,π和 
    
     
      
       
        θ
       
      
      
       \theta
      
     
    θ 的等式,进而求出系数 
    
     
      
       
        π
       
      
      
       \pi
      
     
    π 
     
      
       
        
       
      
     
4. ARIMA(p,d,q)
时间序列不平稳,进行d阶差分后为平稳序列ARMA
 
     
      
       
        
         
          ∇
         
         
          d
         
        
        
         
          x
         
         
          t
         
        
        
         =
        
        
         (
        
        
         1
        
        
         −
        
        
         B
        
        
         
          )
         
         
          d
         
        
        
         
          x
         
         
          t
         
        
        
        
         ϕ
        
        
         (
        
        
         B
        
        
         )
        
        
         (
        
        
         1
        
        
         −
        
        
         B
        
        
         
          )
         
         
          d
         
        
        
         
          x
         
         
          t
         
        
        
         =
        
        
         θ
        
        
         (
        
        
         B
        
        
         )
        
        
         
          w
         
         
          t
         
        
       
       
        \nabla^dx_t=(1-B)^dx_t \\ \phi(B)(1-B)^dx_t=\theta(B)w_t
       
      
     ∇dxt=(1−B)dxtϕ(B)(1−B)dxt=θ(B)wt 一阶差分------消除线性趋势
 二阶差分------消除二次趋势
 差分应适度,过少差分模型仍不平稳,过度差分会引入额外依赖。
5. 季节性模型
5.1 Pure seasonal ARMA
周期为s,记作
    
     
      
       
        A
       
       
        R
       
       
        M
       
       
        A
       
       
        (
       
       
        P
       
       
        ,
       
       
        Q
       
       
        
         )
        
        
         s
        
       
      
      
       ARMA(P,Q)_s
      
     
    ARMA(P,Q)s 
     
      
       
        
         
          Φ
         
         
          P
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         
          x
         
         
          t
         
        
        
         =
        
        
         
          Θ
         
         
          Q
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         
          w
         
         
          t
         
        
        
        
         
          Φ
         
         
          P
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         =
        
        
         1
        
        
         −
        
        
         
          Φ
         
         
          1
         
        
        
         
          B
         
         
          s
         
        
        
         −
        
        
         
          Φ
         
         
          2
         
        
        
         
          B
         
         
          
           2
          
          
           s
          
         
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
         −
        
        
         
          Φ
         
         
          P
         
        
        
         
          B
         
         
          
           P
          
          
           s
          
         
        
        
        
         
          Θ
         
         
          Q
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         =
        
        
         1
        
        
         +
        
        
         
          Θ
         
         
          1
         
        
        
         
          B
         
         
          s
         
        
        
         +
        
        
         
          Θ
         
         
          2
         
        
        
         
          B
         
         
          
           2
          
          
           s
          
         
        
        
         +
        
        
         .
        
        
         .
        
        
         .
        
        
         +
        
        
         
          Θ
         
         
          Q
         
        
        
         
          B
         
         
          
           Q
          
          
           s
          
         
        
       
       
        \Phi_P(B^s)x_t=\Theta_Q(B^s)w_t \\ \Phi_P(B^s)=1-\Phi_1B^s-\Phi_2B^{2s}-...-\Phi_PB^{Ps} \\ \Theta_Q(B^s)=1+\Theta_1B^s+ \Theta_2B^{2s}+...+\Theta_QB^{Qs}
       
      
     ΦP(Bs)xt=ΘQ(Bs)wtΦP(Bs)=1−Φ1Bs−Φ2B2s−...−ΦPBPsΘQ(Bs)=1+Θ1Bs+Θ2B2s+...+ΘQBQs 因果性----
    
     
      
       
        Φ
       
       
        (
       
       
        
         z
        
        
         s
        
       
       
        )
       
      
      
       \Phi(z^s)
      
     
    Φ(zs) 根在单位圆外
 可逆性----
    
     
      
       
        Θ
       
       
        (
       
       
        
         z
        
        
         s
        
       
       
        )
       
      
      
       \Theta(z^s)
      
     
    Θ(zs) 根在单位圆外
5.2 SARIMA
记作
    
     
      
       
        A
       
       
        R
       
       
        I
       
       
        M
       
       
        A
       
       
        (
       
       
        p
       
       
        ,
       
       
        d
       
       
        ,
       
       
        q
       
       
        )
       
       
        ×
       
       
        (
       
       
        P
       
       
        ,
       
       
        D
       
       
        ,
       
       
        Q
       
       
        
         )
        
        
         s
        
       
      
      
       ARIMA(p,d,q)×(P,D,Q)_s
      
     
    ARIMA(p,d,q)×(P,D,Q)s 
     
      
       
        
         
          ∇
         
         
          s
         
         
          D
         
        
        
         =
        
        
         (
        
        
         1
        
        
         −
        
        
         
          B
         
         
          s
         
        
        
         
          )
         
         
          D
         
        
        
        
         
          Φ
         
         
          P
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         ϕ
        
        
         (
        
        
         B
        
        
         )
        
        
         
          ∇
         
         
          s
         
         
          D
         
        
        
         
          ∇
         
         
          d
         
        
        
         
          x
         
         
          t
         
        
        
         =
        
        
         
          Θ
         
         
          Q
         
        
        
         (
        
        
         
          B
         
         
          s
         
        
        
         )
        
        
         θ
        
        
         (
        
        
         B
        
        
         )
        
        
         
          w
         
         
          t
         
        
       
       
        \nabla _s^D=(1-B^s)^D \\ \Phi_P(B^s)\phi(B)\nabla _s^D\nabla^dx_t=\Theta_Q(B^s)\theta(B)w_t 
       
      
     ∇sD=(1−Bs)DΦP(Bs)ϕ(B)∇sD∇dxt=ΘQ(Bs)θ(B)wt 因果性----
    
     
      
       
        Φ
       
       
        (
       
       
        
         z
        
        
         s
        
       
       
        )
       
       
        ,
       
       
        ϕ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \Phi(z^s),\phi(z)
      
     
    Φ(zs),ϕ(z) 根在单位圆外
 可逆性----
    
     
      
       
        Θ
       
       
        (
       
       
        
         z
        
        
         s
        
       
       
        )
       
       
        ,
       
       
        θ
       
       
        (
       
       
        z
       
       
        )
       
      
      
       \Theta(z^s),\theta(z)
      
     
    Θ(zs),θ(z) 根在单位圆外
二、相关系数计算
自协方差函数Autocovariance function of {
     
      
       
        
         
          x
         
         
          t
         
        
       
       
        x_t
       
      
     xt} 记作
     
      
       
        
         γ
        
        
         (
        
        
         h
        
        
         )
        
       
       
        \gamma(h)
       
      
     γ(h)
 根据 
    
     
      
       
        E
       
       
        (
       
       
        
         x
        
        
         t
        
       
       
        )
       
       
        =
       
       
        0
       
      
      
       E(x_t)=0
      
     
    E(xt)=0
 
    
     
      
       
        γ
       
       
        (
       
       
        h
       
       
        )
       
       
        =
       
       
        γ
       
       
        (
       
       
        t
       
       
        +
       
       
        h
       
       
        ,
       
       
        t
       
       
        )
       
       
        =
       
       
        C
       
       
        o
       
       
        v
       
       
        (
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
       
        ,
       
       
        
         x
        
        
         t
        
       
       
        )
       
       
        =
       
       
        E
       
       
        [
       
       
        (
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
       
        −
       
       
        E
       
       
        (
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
       
        )
       
       
        (
       
       
        
         x
        
        
         t
        
       
       
        −
       
       
        E
       
       
        (
       
       
        
         x
        
        
         t
        
       
       
        )
       
       
        ]
       
       
        =
       
       
        E
       
       
        (
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
       
        
         x
        
        
         t
        
       
       
        )
       
      
      
       \gamma(h)= \gamma(t+h,t)=Cov(x_{t+h},x_t)=E[(x_{t+h}-E(x_{t+h})(x_t-E(x_t)]=E(x_{t+h}x_t)
      
     
    γ(h)=γ(t+h,t)=Cov(xt+h,xt)=E[(xt+h−E(xt+h)(xt−E(xt)]=E(xt+hxt)
 对于白噪声
    
     
      
       
        
         w
        
        
         t
        
       
      
      
       w_t
      
     
    wt 
     
      
       
        
         
          γ
         
         
          w
         
        
        
         (
        
        
         h
        
        
         )
        
        
         =
        
        
         
          {
         
         
          
           
            
             
              
               
                σ
               
               
                w
               
               
                2
               
              
              
               ,
              
              
               h
              
              
               =
              
              
               0
              
             
            
           
          
          
           
            
             
              
               0
              
              
               ,
              
              
               o
              
              
               t
              
              
               h
              
              
               e
              
              
               r
              
              
               w
              
              
               i
              
              
               s
              
              
               e
              
             
            
           
          
         
        
       
       
        \gamma_w(h)= \left\{\begin{matrix}\sigma_w^2,h=0\\ 0,otherwise \end{matrix}\right.
       
      
     γw(h)={σw2,h=00,otherwise
1. 自相关ACF
自相关函数Autoccorelation function of {
     
      
       
        
         
          x
         
         
          t
         
        
       
       
        x_t
       
      
     xt} 记作
     
      
       
        
         ρ
        
        
         (
        
        
         h
        
        
         )
        
       
       
        \rho(h)
       
      
     ρ(h)
 
     
      
       
        
         ρ
        
        
         (
        
        
         h
        
        
         )
        
        
         =
        
        
         
          
           γ
          
          
           (
          
          
           h
          
          
           )
          
         
         
          
           γ
          
          
           (
          
          
           0
          
          
           )
          
         
        
       
       
        \rho(h)=\frac{\gamma(h)} {\gamma(0)}
       
      
     ρ(h)=γ(0)γ(h) 显然,有 
     
      
       
        
         ρ
        
        
         (
        
        
         0
        
        
         )
        
        
         =
        
        
         
          
           γ
          
          
           (
          
          
           0
          
          
           )
          
         
         
          
           γ
          
          
           (
          
          
           0
          
          
           )
          
         
        
        
         =
        
        
         1
        
       
       
        \rho(0)=\frac{\gamma(0)}{\gamma(0)}=1
       
      
     ρ(0)=γ(0)γ(0)=1
1.1 AR(1)
表达式: x t = ϕ x t − 1 + w t , w t ∼ w n ( 0 , σ w 2 ) x t = ∑ j = 0 ∞ ϕ j w t − j x_t=\phi x_{t-1}+w_t,w_t\sim wn(0,\sigma_w^2) \\ x_t=\sum_{j=0}^{\infty} \phi^jw_{t-j} xt=ϕxt−1+wt,wt∼wn(0,σw2)xt=j=0∑∞ϕjwt−j 自协方差函数 γ ( h ) \gamma(h) γ(h)及ACF ρ ( h ) \rho(h) ρ(h) γ ( h ) = σ w 2 ϕ h 1 − ϕ 2 ρ ( h ) = ϕ h \gamma(h)=\frac{\sigma_w^2\phi^h}{1-\phi^2} \\ \rho(h)=\phi^h γ(h)=1−ϕ2σw2ϕhρ(h)=ϕh
1.2 AR(2)
表达式: x t = ϕ 1 x t − 1 + ϕ 2 x t − 2 + w t , w t ∼ w n ( 0 , σ w 2 ) x_t=\phi_1x_{t-1}+\phi_2x_{t-2}+w_t,w_t\sim wn(0,\sigma_w^2) xt=ϕ1xt−1+ϕ2xt−2+wt,wt∼wn(0,σw2) 对两边同乘 x t − h x_{t-h} xt−h并取期望 E ( x t x t − h ) = ϕ 1 E ( x t − 1 x t − h ) + ϕ 2 E ( x t − 2 x t − h ) γ ( h ) = ϕ 1 γ ( h − 1 ) + ϕ 2 γ ( h − 2 ) , h = 1 , 2... ρ ( h ) = ϕ 1 ρ ( h − 1 ) + ϕ 2 ρ ( h − 2 ) , h = 1 , 2... E(x_tx_{t-h})=\phi_1E(x_{t-1}x_{t-h} )+\phi_2E(x_{t-2}x_{t-h})\\ \gamma(h)=\phi_1\gamma(h-1)+\phi_2\gamma(h-2),h=1,2... \\ \rho(h)=\phi_1\rho(h-1)+\phi_2\rho(h-2),h=1,2... E(xtxt−h)=ϕ1E(xt−1xt−h)+ϕ2E(xt−2xt−h)γ(h)=ϕ1γ(h−1)+ϕ2γ(h−2),h=1,2...ρ(h)=ϕ1ρ(h−1)+ϕ2ρ(h−2),h=1,2... 可以推出: ρ ( 1 ) = ϕ 1 ρ ( 0 ) + ϕ 2 ρ ( 1 ) ρ ( 1 ) = ϕ 1 ρ ( 0 ) 1 − ϕ 2 = ϕ 1 1 − ϕ 2 \rho(1)=\phi_1\rho(0)+\phi_2\rho(1) \\\rho(1)= \frac{\phi_1\rho(0)}{1-\phi_2} = \frac{\phi_1}{1-\phi_2} ρ(1)=ϕ1ρ(0)+ϕ2ρ(1)ρ(1)=1−ϕ2ϕ1ρ(0)=1−ϕ2ϕ1 由齐次差分方程,得通解 : ϕ ( z ) = 0 ⟹ z 1 , z 2 ρ ( h ) = c 1 ( z 1 ) − h + c 2 ( z 2 ) − h \phi(z)=0 \Longrightarrow z_1,z_2 \\\rho(h)=c_1(z_1)^{-h}+c_2(z_2)^{-h} ϕ(z)=0⟹z1,z2ρ(h)=c1(z1)−h+c2(z2)−h根据得到的 ρ ( 0 ) , ρ ( 1 ) \rho(0),\rho(1) ρ(0),ρ(1) 代入通解,求得 c 1 , c 2 c_1,c_2 c1,c2,最终得到 ρ ( h ) \rho(h) ρ(h)
1.3 MA(1)
表达式: x t = w t + θ w t − 1 , w t ∼ w n ( 0 , σ w 2 ) w t = ∑ j = 0 ∞ ( − θ ) j x t − j x_t=w_t+\theta w_{t-1},w_t \sim wn(0,\sigma_w^2) \\ w_t=\sum_{j=0}^{\infty}(-\theta)^jx_{t-j} xt=wt+θwt−1,wt∼wn(0,σw2)wt=j=0∑∞(−θ)jxt−j 自协方差函数 γ ( h ) \gamma(h) γ(h): γ ( h ) = { ( 1 + θ 2 ) σ w 2 , h = 0 θ σ w 2 , h = 1 0 , h > 1 \gamma(h)=\left\{\begin{matrix} (1+\theta^2)\sigma_w^2,h=0 \\\theta\sigma_w^2,h=1 \\0,h>1 \end{matrix}\right. γ(h)=⎩⎨⎧(1+θ2)σw2,h=0θσw2,h=10,h>1 计算ACF ρ ( h ) \rho(h) ρ(h) ρ ( h ) = { θ 1 + θ 2 , h = 1 0 , h > 1 \rho(h)=\left\{\begin{matrix} \frac{\theta}{1+\theta^2},h=1 \\ 0,h>1 \end{matrix}\right. ρ(h)={1+θ2θ,h=10,h>1
1.4 MA(q)
自协方差函数: γ ( h ) = { σ w 2 ∑ j = 0 q − h θ j θ j + h , 0 ≤ h ≤ q 0 , h > q \gamma(h)=\left\{\begin{matrix} \sigma_w^2 \sum_{j=0}^{q-h} \theta_j\theta_{j+ h},0\leq h \leq q\\ 0,h>q \end{matrix}\right. γ(h)={σw2∑j=0q−hθjθj+h,0≤h≤q0,h>q 计算ACF ρ ( h ) \rho(h) ρ(h) ρ ( h ) = { ∑ j = 0 q − h θ j θ j + h 1 + θ 1 2 + θ 2 2 + . . . + θ q 2 , 1 ≤ h ≤ q 0 , h > q \rho(h)=\left\{\begin{matrix} \frac{ \sum_{j=0}^{q-h}\theta_j\theta_{j+h}}{1+\theta_1^2+\theta_2^2+...+\theta_q^2},1 \leq h\leq q \\ \\ 0,h>q \end{matrix}\right. ρ(h)=⎩⎪⎨⎪⎧1+θ12+θ22+...+θq2∑j=0q−hθjθj+h,1≤h≤q0,h>q
1.5 ARMA(p,q)
与求AR(
     
      
       
        
         p
        
       
       
        p
       
      
     p)的ACF思路相同,将ARMA(p,q)转为AR(
     
      
       
        
         p
        
       
       
        p
       
      
     p)的形式
 已知系数
    
     
      
       
        ψ
       
       
        ,
       
       
        
         x
        
        
         t
        
       
       
        =
       
       
        
         ∑
        
        
         
          j
         
         
          =
         
         
          0
         
        
        
         ∞
        
       
       
        
         ψ
        
        
         j
        
       
       
        
         w
        
        
         
          t
         
         
          −
         
         
          j
         
        
       
      
      
       \psi,x_t=\sum_{j=0}^{\infty}\psi_jw_{t-j}
      
     
    ψ,xt=∑j=0∞ψjwt−j
 先由p阶齐次方程得到自相关函数通解:
     
      
       
        
         γ
        
        
         (
        
        
         h
        
        
         )
        
        
         −
        
        
         
          ϕ
         
         
          1
         
        
        
         γ
        
        
         (
        
        
         h
        
        
         −
        
        
         1
        
        
         )
        
        
         −
        
        
         .
        
        
         .
        
        
         .
        
        
         −
        
        
         
          ϕ
         
         
          p
         
        
        
         γ
        
        
         (
        
        
         h
        
        
         −
        
        
         p
        
        
         )
        
        
         =
        
        
         0
        
        
         ,
        
        
         h
        
        
         ≥
        
        
         m
        
        
         a
        
        
         x
        
        
         (
        
        
         p
        
        
         ,
        
        
         q
        
        
         +
        
        
         1
        
        
         )
        
       
       
        \gamma(h)-\phi_1\gamma(h-1)-...-\phi_p\gamma(h-p)=0,h\geq max(p,q+1) 
       
      
     γ(h)−ϕ1γ(h−1)−...−ϕpγ(h−p)=0,h≥max(p,q+1) 再根据初始条件 
     
      
       
        
         γ
        
        
         (
        
        
         h
        
        
         )
        
        
         −
        
        
         
          ∑
         
         
          
           j
          
          
           =
          
          
           1
          
         
         
          p
         
        
        
         
          ϕ
         
         
          j
         
        
        
         γ
        
        
         (
        
        
         h
        
        
         −
        
        
         j
        
        
         )
        
        
         =
        
        
         
          σ
         
         
          w
         
         
          2
         
        
        
         
          ∑
         
         
          
           j
          
          
           =
          
          
           h
          
         
         
          q
         
        
        
         
          θ
         
         
          j
         
        
        
         
          ψ
         
         
          
           j
          
          
           −
          
          
           h
          
         
        
        
         ,
        
        
         0
        
        
         ≤
        
        
         h
        
        
         <
        
        
         m
        
        
         a
        
        
         x
        
        
         (
        
        
         p
        
        
         ,
        
        
         q
        
        
         +
        
        
         1
        
        
         )
        
       
       
        \gamma(h)-\sum_{j=1}^p\phi_j\gamma(h-j)=\sigma_w^2 \sum_{j=h}^q\theta_j\psi_{j-h},0 \leq h<max(p,q+1) 
       
      
     γ(h)−j=1∑pϕjγ(h−j)=σw2j=h∑qθjψj−h,0≤h<max(p,q+1) 将得到的自相关函数等式分别除以
    
     
      
       
        γ
       
       
        (
       
       
        0
       
       
        )
       
      
      
       \gamma(0)
      
     
    γ(0),最终得出
    
     
      
       
        ρ
       
       
        (
       
       
        h
       
       
        )
       
      
      
       \rho(h)
      
     
    ρ(h) 
     
      
       
        
       
      
     
2. 偏自相关PACF
平稳过程的偏自相关函数 Partial Autoccorelation function of {
     
      
       
        
         
          x
         
         
          t
         
        
       
       
        x_t
       
      
     xt} 记作
     
      
       
        
         
          ϕ
         
         
          
           h
          
          
           h
          
         
        
       
       
        \phi_{hh}
       
      
     ϕhh
 
    
     
      
       
        
         
          x
         
         
          
           t
          
          
           +
          
          
           h
          
         
        
        
         ^
        
       
      
      
       \hat{x_{t+h}}
      
     
    xt+h^和
    
     
      
       
        
         
          x
         
         
          t
         
        
        
         ^
        
       
      
      
       \hat{x_t}
      
     
    xt^分别是{
    
     
      
       
        
         x
        
        
         
          t
         
         
          +
         
         
          1
         
        
       
       
        ,
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          2
         
        
       
       
        ,
       
       
        .
       
       
        .
       
       
        .
       
       
        ,
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
         
          −
         
         
          1
         
        
       
      
      
       x_{t+1},x_{t+2},...,x_{t+h-1}
      
     
    xt+1,xt+2,...,xt+h−1} 对
    
     
      
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
      
      
       x_{t+h}
      
     
    xt+h和
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt的线性回归
 
    
     
      
       
        
         ϕ
        
        
         
          h
         
         
          h
         
        
       
      
      
       \phi_{hh}
      
     
    ϕhh是
    
     
      
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
        
       
      
      
       x_{t+h}
      
     
    xt+h和
    
     
      
       
        
         x
        
        
         t
        
       
      
      
       x_t
      
     
    xt在移去{
    
     
      
       
        
         x
        
        
         
          t
         
         
          +
         
         
          1
         
        
       
       
        ,
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          2
         
        
       
       
        ,
       
       
        .
       
       
        .
       
       
        .
       
       
        ,
       
       
        
         x
        
        
         
          t
         
         
          +
         
         
          h
         
         
          −
         
         
          1
         
        
       
      
      
       x_{t+1},x_{t+2},...,x_{t+h-1}
      
     
    xt+1,xt+2,...,xt+h−1}的影响后的相关系数
 
     
      
       
        
         
          ϕ
         
         
          11
         
        
        
         =
        
        
         c
        
        
         o
        
        
         r
        
        
         r
        
        
         (
        
        
         
          x
         
         
          
           t
          
          
           +
          
          
           1
          
         
        
        
         ,
        
        
         
          x
         
         
          t
         
        
        
         )
        
        
         =
        
        
         ρ
        
        
         (
        
        
         1
        
        
         )
        
        
        
         
          ϕ
         
         
          
           h
          
          
           h
          
         
        
        
         =
        
        
         c
        
        
         o
        
        
         r
        
        
         r
        
        
         (
        
        
         
          x
         
         
          
           t
          
          
           +
          
          
           h
          
         
        
        
         −
        
        
         
          
           x
          
          
           
            t
           
           
            +
           
           
            h
           
          
         
         
          ^
         
        
        
         ,
        
        
         
          x
         
         
          t
         
        
        
         −
        
        
         
          
           x
          
          
           t
          
         
         
          ^
         
        
        
         )
        
        
         ,
        
        
         h
        
        
         ≥
        
        
         2
        
       
       
        \phi_{11}=corr(x_{t+1},x_t)=\rho(1) \\ \phi_{hh}=corr(x_{t+h}-\hat{x_{t+h}},x_t-\hat{x_t}),h\geq2
       
      
     ϕ11=corr(xt+1,xt)=ρ(1)ϕhh=corr(xt+h−xt+h^,xt−xt^),h≥2
2.1 AR(1)
ϕ 11 = 1 ϕ h h = 0 , h > 1 \phi_{11}=1\\ \phi_{hh}=0 ,h>1 ϕ11=1ϕhh=0,h>1
2.2 AR(2)
ϕ 11 = 1 ϕ 22 = ϕ 2 ϕ h h = 0 , h > 2 \phi_{11}=1\\ \phi_{22}=\phi_2 \\ \phi_{hh}=0 ,h>2 ϕ11=1ϕ22=ϕ2ϕhh=0,h>2
2.3 MA(1)
ϕ h h = − ( − θ ) h ( 1 − θ 2 ) 1 − θ 2 ( h + 1 ) , h ≥ 1 \phi_{hh}=-\frac{(-\theta)^h(1-\theta^2)}{1-\theta^{2(h+1)}},h\geq1 ϕhh=−1−θ2(h+1)(−θ)h(1−θ2),h≥1
2.5 Durbin-Levinson算法
     
      
       
        
         
          ϕ
         
         
          
           h
          
          
           h
          
         
        
        
         =
        
        
         
          
           ρ
          
          
           (
          
          
           h
          
          
           )
          
          
           −
          
          
           
            ∑
           
           
            
             k
            
            
             =
            
            
             1
            
           
           
            
             h
            
            
             −
            
            
             1
            
           
          
          
           
            ϕ
           
           
            
             h
            
            
             −
            
            
             1
            
            
             ,
            
            
             k
            
           
          
          
           ρ
          
          
           (
          
          
           h
          
          
           −
          
          
           k
          
          
           )
          
         
         
          
           1
          
          
           −
          
          
           
            ∑
           
           
            
             k
            
            
             =
            
            
             1
            
           
           
            
             h
            
            
             −
            
            
             1
            
           
          
          
           
            ϕ
           
           
            
             h
            
            
             −
            
            
             1
            
            
             ,
            
            
             k
            
           
          
          
           ρ
          
          
           (
          
          
           k
          
          
           )
          
         
        
       
       
        \phi_{hh}=\frac{\rho(h)-\sum_{k=1}^{h-1}\phi_{h-1,k}\rho(h-k)}{1-\sum_{k=1}^{h-1}\phi_{h-1,k}\rho(k)}
       
      
     ϕhh=1−∑k=1h−1ϕh−1,kρ(k)ρ(h)−∑k=1h−1ϕh−1,kρ(h−k) 其中,当
    
     
      
       
        h
       
       
        ≥
       
       
        2
       
      
      
       h\geq2
      
     
    h≥2时,
    
     
      
       
        
         ϕ
        
        
         
          h
         
         
          k
         
        
       
       
        =
       
       
        
         ϕ
        
        
         
          h
         
         
          −
         
         
          1
         
         
          ,
         
         
          k
         
        
       
       
        −
       
       
        
         ϕ
        
        
         
          h
         
         
          h
         
        
       
       
        
         ϕ
        
        
         
          h
         
         
          −
         
         
          1
         
         
          ,
         
         
          h
         
         
          −
         
         
          k
         
        
       
      
      
       \phi_{hk}=\phi_{h-1,k}-\phi_{hh}\phi_{h-1,h-k}
      
     
    ϕhk=ϕh−1,k−ϕhhϕh−1,h−k
 对于AR(
    
     
      
       
        p
       
      
      
       p
      
     
    p), 
    
     
      
       
        
         ϕ
        
        
         
          p
         
         
          p
         
        
       
       
        =
       
       
        
         ϕ
        
        
         p
        
       
      
      
       \phi_{pp}=\phi_p
      
     
    ϕpp=ϕp,且 
    
     
      
       
        h
       
       
        >
       
       
        p
       
      
      
       h>p
      
     
    h>p 时,
    
     
      
       
        
         ϕ
        
        
         
          h
         
         
          h
         
        
       
       
        =
       
       
        0
       
      
      
       \phi_{hh}=0
      
     
    ϕhh=0
2.4 Yule-Walker Equation
    
     
      
       
        [
       
       
        
         
          
           
            
             ρ
            
            
             (
            
            
             1
            
            
             )
            
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             2
            
            
             )
            
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             3
            
            
             )
            
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             )
            
           
          
         
        
       
       
        ]
       
      
      
       \begin{bmatrix} \rho(1)\\ \rho(2)\\ \rho(3)\\.\\.\\.\\ \rho(h) \end{bmatrix}
      
     
    ⎣⎢⎢⎢⎢⎢⎢⎢⎢⎡ρ(1)ρ(2)ρ(3)...ρ(h)⎦⎥⎥⎥⎥⎥⎥⎥⎥⎤ = 
    
     
      
       
        [
       
       
        
         
          
           
            1
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             1
            
            
             )
            
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             2
            
            
             )
            
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             1
            
            
             )
            
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             1
            
            
             )
            
           
          
         
         
          
           
            1
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             1
            
            
             )
            
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             2
            
            
             )
            
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             2
            
            
             )
            
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             1
            
            
             )
            
           
          
         
         
          
           
            1
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             3
            
            
             )
            
           
          
         
        
        
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
          
         
         
          
           
          
         
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
          
         
         
          
           
          
         
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
          
         
         
          
           
          
         
         
          
           
            .
           
          
         
        
        
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             1
            
            
             )
            
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             2
            
            
             )
            
           
          
         
         
          
           
            
             ρ
            
            
             (
            
            
             h
            
            
             −
            
            
             3
            
            
             )
            
           
          
         
         
          
           
            .
           
          
         
         
          
           
            .
           
          
         
         
          
           
            1
           
          
         
        
       
       
        ]
       
      
      
       \begin{bmatrix} 1&\rho(1)&\rho(2)&.&.&\rho(h-1)\\ \rho(1)&1&\rho(1)&.&.&\rho(h-2)\\ \rho(2)&\rho(1)&1&.&.&\rho(h-3)\\.&.&.&&&.\\.&.&.&&&.\\.&.&.&&&.\\ \rho(h-1)&\rho(h-2)&\rho(h-3)&.&.&1 \end{bmatrix}
      
     
    ⎣⎢⎢⎢⎢⎢⎢⎢⎢⎡1ρ(1)ρ(2)...ρ(h−1)ρ(1)1ρ(1)...ρ(h−2)ρ(2)ρ(1)1...ρ(h−3)........ρ(h−1)ρ(h−2)ρ(h−3)...1⎦⎥⎥⎥⎥⎥⎥⎥⎥⎤ 
    
     
      
       
        [
       
       
        
         
          
           
            
             ϕ
            
            
             
              h
             
             
              ,
             
             
              1
             
            
           
          
         
        
        
         
          
           
            
             ϕ
            
            
             
              h
             
             
              ,
             
             
              2
             
            
           
          
         
        
        
         
          
           
            
             ϕ
            
            
             
              h
             
             
              ,
             
             
              3
             
            
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            .
           
          
         
        
        
         
          
           
            
             ϕ
            
            
             
              h
             
             
              ,
             
             
              h
             
            
           
          
         
        
       
       
        ]
       
      
      
       \begin{bmatrix} \phi_{h,1}\\ \phi_{h,2}\\ \phi_{h,3}\\.\\.\\.\\ \phi_{h,h} \end{bmatrix}
      
     
    ⎣⎢⎢⎢⎢⎢⎢⎢⎢⎡ϕh,1ϕh,2ϕh,3...ϕh,h⎦⎥⎥⎥⎥⎥⎥⎥⎥⎤
 循环计算,每一组方程组的 
    
     
      
       
        
         ϕ
        
        
         
          h
         
         
          ,
         
         
          h
         
        
       
      
      
       \phi_{h,h}
      
     
    ϕh,h即为 
    
     
      
       
        
         ϕ
        
        
         
          h
         
         
          h
         
        
       
      
      
       \phi_{hh}
      
     
    ϕhh
3. 小结
| AR( p p p) | MA(q) | ARMA(p,q) | |
|---|---|---|---|
| ACF | 拖尾 | 在lag=q之后截尾 | 拖尾 | 
| PACF | 在lag=p之后截尾 | 拖尾 | 拖尾 | 
| SARMA | AR( P P P) s _s s | MA(Q) s _s s | ARMA(P,Q) s _s s | 
|---|---|---|---|
| ACF | 在lag=ks 处拖尾 (k=1,2,…) | 在lag=Qs处截尾 | 在lag=ks处拖尾 | 
| PACF | 在lag=Ps处截尾 | 在lag=ks处拖尾(k=1,2,…) | 在lag=ks处拖尾 | 
在非季节性滞后点(h ≠ \neq =ks)处,值为0
三. R 代码
## E.g. AR(2) phi1=0.2,phi2=0.8
#生成100个模拟数
ar2 = arima.sim(list(order=c(2,0,0), ar=c(-.2,-.8)), n = 100)
#计算该模型的acf
ACF_AR2 = ARMAacf(ar=c(-.2,-.8), ma=0, 50)
#画出acf图
plot(ACF_AR2, type="h", xlab="lag")
abline(h=0)
title("AR(2)")
#计算该模型的pacf
PACF_AR2 = ARMAacf(ar=c(-.2,-.8), ma=0, 10,pacf=TRUE)
#画出pacf图
plot(PACF_AR2, type="h", xlab="lag")
title("AR(2)")
abline(h=0)
 
#使用 R包中的时间序列数据
library(astsa)
plot.ts(globtemp)  #画出时间序列,观察趋势
acf(globtemp) #画出acf
pacf(globtemp) #画出pacf
#进行一阶差分
globtemp_d <- diff(globtemp)
plot.ts(globtemp_d)
#画acf和pacf
par(mfrow = c(2,1))
acf(globtemp_d)
pacf(globtemp_d)
#拟合ARIMA(0,1,2)
sarima(globtemp, 0, 1, 2)
#预测之后10个序列值
sarima.for(globtemp, 10, 0, 1, 2) #输出预测值,SE和预测图
#若为季节性时间序列模型
#使用 UnempRate 数据(月度数据),选择模型为(3,1,2)×(0,1,1),s=12
sarima(UnempRate,3,1,2,0,1,1,12) #拟合模型
sarima.for(UnempRate,12, 3,1,2,0,1,1,12)  #预测下一年(12个月)
 
参考书目
Time Series Analysis and Its Applications with R examples
 Time Series Analysis With Applications in R










