ADF-test in statsmodels in Python

Ich versuche zu laufen, eine Augmented-Dickey-Fuller-test in statsmodels in Python, aber ich scheine da etwas zu fehlen.

Dies ist der code, den ich versuche:

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

x = np.array([1,2,3,4,3,4,2,3])
result = ts.adfuller(x)

Bekomme ich die folgende Fehlermeldung:

Traceback (most recent call last):
  File "C:\Users\Akavall\Desktop\Python\Stats_models\stats_models_test.py", line 12, in <module>
    result = ts.adfuller(x)
  File "C:\Python27\lib\site-packages\statsmodels-0.4.1-py2.7-win32.egg\statsmodels\tsa\stattools.py", line 201, in adfuller
    xdall = lagmat(xdiff[:,None], maxlag, trim='both', original='in')
  File "C:\Python27\lib\site-packages\statsmodels-0.4.1-py2.7-win32.egg\statsmodels\tsa\tsatools.py", line 305, in lagmat
    raise ValueError("maxlag should be < nobs")
ValueError: maxlag should be < nobs

Meine Numpy Version: 1.6.1
Meine statsmodels Version: 0.4.1
Ich bin mit windows.

Ich freue mich auf die Dokumentation hier aber kann nicht herausfinden, was ich falsch mache. Was bin ich?

Vielen Dank im Voraus.

InformationsquelleAutor Akavall | 2012-06-29

Schreibe einen Kommentar