1

constant_all = [38.315546998853549、40.187217618535399、43.71380567455396、45.450748920811293、50.112269986599735、59.275158665010736、65.979556682432815、106.81142772445702、122.61124737594076、160.38976378829483、109.69662873794118、86.785774468513864、73.201627114685436、62.980558157294979、60.149903740134562、54.010569668890867、54.657627915195405、57.065262050299623、59.576109894133168、61.568376379726971、64.51074294474725]アドラーテストではいつもゼロになるのですか?

私は上記のようなリストを取得しました。そして、私はcadf = ts.adfuller(constant_all)を使って充実したテストを実行してから、p値にcadf[0]でアクセスしたいと思います。

しかし、私はいつもゼロを得ました。私は間違った何かをしましたか? cadf[1]はあなたのケースでは約0.959である、P - 値である一方、the documentationによると

答えて

0

cadf[0]は、検定統計量です。参照の便宜上

、私たちはまた、ハイとローの両方P - 値として追加してみましょう:

import statsmodels.tsa.stattools as ts 
import numpy as np 

# Generate random residuals 
np.random.seed(0) 
errors = np.random.normal(0, 1, 1000) 

# Create AR(1) samples for models with and without unit roots 
x_unit_root = [0] 
x_no_unit_root = [0] 
for i in range(len(errors)): 
    x_unit_root.append(x_unit_root[-1] + errors[i]) 
    x_no_unit_root.append(0.9*x_no_unit_root[-1] + errors[i]) 

# Calculate Augmented Dickey--Fuller p-values 
ts.adfuller(x_unit_root)[1], ts.adfuller(x_no_unit_root)[1] 
# (0.89251931327396528, 3.8562004970538103e-06) 
+0

を 'res'は何ですか? – Jarad

+0

申し訳ありませんが、それは 'errors'です。答えを更新しましょう。 – fuglede

関連する問題