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

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

Python コード:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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])
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])
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因果関係検定の統計量