二阶自回归过程matlab,时间序列分析:二阶自回归过程
時間序列分析:二階自回歸過程
Author: nex3z
2019-07-13
1. 定義
對于二階自回歸過程 $AR(2)$
\begin{equation}
X_t = \phi_1 X_{t-1} + \phi_2 X_{t-2} + e_t \tag{1}
\end{equation}
假設 $e_t$ 獨立于 $Y_{t-1}, Y_{t-2}, \cdots$。式 $(1)$ 也可以表示為
\begin{equation}
X_t – \phi_1 X_{t-1} – \phi_2 X_{t-2} = e_t
\end{equation}
即
\begin{equation}
\phi(B) X_t = e_{t} \tag{2}
\end{equation}
其中
\begin{equation}
\phi(B) = 1 – \phi_1 B – \phi_2 B^2 \tag{3}
\end{equation}
$AR(2)$ 的特征方程為 $\phi(B) = 0$,即
\begin{equation}
1 – \phi_1 B – \phi_2 B^2 = 0 \tag{4}
\end{equation}
上述特征方程是一個二次方程,總有兩個跟(含復根)。
2. $AR(2)$ 過程的平穩性
可以證明,在 $e_t$ 獨立于 $Y_{t-1}, Y_{t-2}, \cdots$ 的條件下,當且僅當 $AR$ 特征方程的根的絕對值(模)大于 $1$ 時,方程 $(1)$ 有平穩解。這一條件也可以表述為復平面上的根在單位圓外。這個結論可以不加任何改變地推廣到 $p$ 階的情況。
在式 $(1)$ 所示的 $AR(2)$ 過程中,容易找到二次特征方程 $(4)$ 的兩個根為
\begin{equation}
\frac{\phi_1 \pm \sqrt{\phi_1^2 + 4 \phi_2}}{-2\phi_2} \tag{5}
\end{equation}
為了滿足平穩條件,要求式 $(5)$ 的絕對值大于 $1$。可以證明,為了平穩性成立,當且僅當滿足一下三個條件
\begin{equation}
\phi_1 + \phi_2 < 1 \qquad \phi_1 + \phi_2 < 1 \qquad |\phi_2| < 1 \tag{6}
\end{equation}
稱式 $(6)$ 所示的條件為 $AR(2)$ 模型的平穩條件。
3. $AR(2)$ 過程的自相關函數
假設式 $(1)$ 所描述的 $AR(2)$ 過程是平穩的,且具有零均值,在式 $(1)$ 等號兩邊同乘以 $X_{t-k}$ 并求期望,得
\begin{equation}
\gamma_k = \phi_1 \gamma_{k-1} + \phi_2 \gamma_{k-2}, \qquad k = 1, 2, 3, \cdots \tag{7}
\end{equation}
在式 $(7)$ 的等號兩邊同除以 $\gamma_0$,得
\begin{equation}
\rho_k = \phi_1 \rho_{k-1} + \phi_2 \rho_{k-2}, \qquad k = 1, 2, 3, \cdots \tag{8}
\end{equation}
稱式 $(7)$ 或式 $(8)$ 為 Yule-Walker 方程。當 $k = 1$ 時,有 $\rho_1 = \phi_1 \rho_0 + \phi_2 \rho_{-1}$,由 $\rho_0 = 1$,$\rho_{-1} = \rho_1$,得 $\rho_1 = \phi_1 + \phi_2 \rho_1$,進而解得
\begin{equation}
\rho_1 = \frac{\phi_1}{1 – \phi_2} \tag{9}
\end{equation}
當 $k = 2$ 時,有
\begin{equation}
\rho_2 = \phi_1 \rho_1 + \phi_2 \rho_0 = \frac{\phi_2(1 – \phi_2) + \phi_1^2}{1 – \phi_2} \tag{10}
\end{equation}
可見,通過式 $(8)$ 可以在已知 $\phi_1$ 和 $\phi_2$ 時計算出自相關值。
$\rho_k$ 的更一般的計算方法取決于特征方程 $1 – \phi_1 B – \phi_2 B^2 = 0$ 的根,用 $G_1, G_2$ 表示特征根的倒數,有
\begin{equation}
G_1 = \frac{\phi_1 – \sqrt{\phi_1^2 + 4\phi_2}}{2}, \qquad G_2 = \frac{\phi_1 + \sqrt{\phi_1^2 + 4\phi_2}}{2}
\end{equation}
如果 $G_1 \neq G_2$ (即 $\phi_1^2 + 4 \phi_2^2 > 0$),可以證明有
\begin{equation}
\rho_k = \frac{(1 – G_2^2)G_1^{k+1} – (1 – G_1^2)G_2^{k+1}}{(G_2 – G_1)(1 + G_1G_2)}, \qquad k = 0, 1, 2, \cdots \tag{11}
\end{equation}
如果特征根時復數(即 $\phi_1^2 + 4 \phi_2^2 < 0$),則 $\rho_k$ 可以表示為
\begin{equation}
\rho_k = R^k \frac{\sin(\Theta k + \Phi)}{\sin(\Phi)}, \qquad k = 0, 1, 2, \cdots \tag{12}
\end{equation}
其中 $R = \sqrt{-\phi_2}$,$\Theta$ 和 $\Phi$ 可以由 $\cos(\Theta) = \phi_1 / (2\sqrt{-\phi_2})$,$\tan(\Phi) = (1 – \phi_2) / (1 + \phi_2)$ 解得。
如果特征根相等(即 $\phi_1^2 + 4 \phi_2^2 = 0$),則有
\begin{equation}
\rho_k = \bigg( 1 + \frac{1 + \phi_2}{1 – \phi_2} \bigg) \bigg( \frac{\phi_1}{2} \bigg)^k, \qquad k = 0, 1, 2, \cdots \tag{13}
\end{equation}
由式 $(11)$、$(12)$、$(13)$ 可以看到,$\rho_k$ 的可以有各種形狀,但始終隨滯后階數 $k$ 的增加而指數遞減。當特征方程有復數根時,$\rho_k$ 表現為具有阻尼因子 $R$($0 \leq R \leq 1$)、頻率 $\Theta$ 和相位 $\Phi$ 的阻尼正弦波動曲線。
當 $\theta_1 = 0.5, \theta_2 = 0.25$ 時,有兩個相異的實特征根,ACF 圖像如圖 1。
ar
acf(ar)
圖 1
當 $\theta_1 = 1, \theta_2 = -0.25$ 時,有兩個相同的實特征根,ACF 圖像如圖 2。
ar
acf(ar)
圖 2
當 $\theta_1 = 1.5, \theta_2 = -0.8$ 時,有兩個負特征根,ACF 圖像如圖 3。
ar
acf(ar)
圖 3
4. $AR(2)$ 過程的方差
由式 $(1)$ 計算 $AR(2)$ 過程的方差
\begin{align}
\gamma_0 &= \mathrm{Var}(X_t) = \mathrm{Var}(\phi_1 X_{t-1} + \phi_2 X_{t-2} + e_t) \\
&= \mathrm{Var}(\phi_1 X_{t-1} + \phi_2 X_{t-2}) + \mathrm{Var}(e_t) \\
&= \mathrm{Var}(\phi_1 X_{t-1}) + \mathrm{Var}(\phi_2 X_{t-2}) + 2 \mathrm{Cov}(\phi_1 X_{t-1}, \phi_2 X_{t-2}) + \mathrm{Var}(e_t) \\
&= \phi_1^2 \gamma_0 + \phi_2^2 \gamma_0 + 2 \phi_1 \phi_2 \gamma_1 + \sigma_e^2 \\
&= (\phi_1^2 + \phi_2^2)\gamma_0 + 2 \phi_1 \phi_2 \gamma_1 + \sigma_e^2 \tag{14}
\end{align}
在式 $(7)$ 中令 $k = 1$,有 $\gamma_1 = \phi_1 \gamma_0 + \phi_2 \gamma_{-1}$,又由 $\gamma_{-1} = \gamma_{1}$,故有
\begin{equation}
\gamma_1 = \phi_1 \gamma_0 + \phi_2 \gamma_1 \tag{15}
\end{equation}
結合式 $(14)$、$(15)$,解得
\begin{align}
\gamma_0 &= \frac{(1 – \phi_2)\sigma_e^2}{(1 – \phi_2)(1 – \phi_1^2 – \phi_2^2) – 2\phi_2\phi_1^2} \\
&= \frac{1 – \phi_2}{1 + \phi_2} \cdot \frac{\sigma_e^2}{(1 – \phi_2)^2 – \phi_1^2} \tag{16}
\end{align}
總結
以上是生活随笔為你收集整理的二阶自回归过程matlab,时间序列分析:二阶自回归过程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 建行支付宝卡怎么用?
- 下一篇: 用matlab解一维单势垒波函数,一维多