Python 時系列分析 1,000本ノック
– ノック46: 見せかけの回帰と共和分検定 –

Python 時系列分析 1,000本ノック– ノック46: 見せかけの回帰と共和分検定 –
次の Python コードの出力はどれでしょうか?

Python コード:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
from statsmodels.tsa.stattools import coint
import numpy as np
np.random.seed(42)
x = np.random.randn(100).cumsum()
y = x + np.random.randn(100)
coint_t, p_value, crit_value = coint(x, y)
print(f'Cointegration test statistic: {coint_t}')
print(f'p-value: {p_value}')
from statsmodels.tsa.stattools import coint import numpy as np np.random.seed(42) x = np.random.randn(100).cumsum() y = x + np.random.randn(100) coint_t, p_value, crit_value = coint(x, y) print(f'Cointegration test statistic: {coint_t}') print(f'p-value: {p_value}')
from statsmodels.tsa.stattools import coint
import numpy as np

np.random.seed(42)

x = np.random.randn(100).cumsum()

y = x + np.random.randn(100) 

coint_t, p_value, crit_value = coint(x, y)
print(f'Cointegration test statistic: {coint_t}')
print(f'p-value: {p_value}')

 

回答の選択肢:

(A) p値が0.01未満
(B) p値が0.01以上0.05未満
(C) p値が0.05以上0.10未満
(D) p値が0.10以上