Python 時系列分析 1,000本ノック
– ノック42: 時系列データのグレンジャー因果検定 –

Python 時系列分析 1,000本ノック– ノック42: 時系列データのグレンジャー因果検定 –
次の Python コードの出力はどれでしょうか?

Python コード:

from statsmodels.tsa.stattools import grangercausalitytests
import numpy as np

np.random.seed(26)
x = np.random.randn(100)
y = np.random.randn(100)
data = np.column_stack([x, y])

result = grangercausalitytests(
    data,
    maxlag=2,
    verbose=False)

print(result[1][0]['ssr_chi2test'][1])

 

回答の選択肢:

(A) 1次ラグにおけるGranger因果関係検定のp値
(B) 1次ラグにおけるGranger因果関係検定の統計量
(C) 2次ラグにおけるGranger因果関係検定のp値
(D) 2次ラグにおけるGranger因果関係検定の統計量

Python 時系列分析 1,000本ノック– ノック43: 時系列データの距離 –