简体   繁体   中英

How to set constant number of lags of a time series data inside sts.adfuller() function test?

adfuller test gives each variable a different number of lags. hence different P-value. How to get the same p-value, and how to set the no. of lags in each variable?

Theses are adfuller test results for two variables with same size but it shows different number and lags and different p-value!

(-1.6111475029851472,
 0.4773732658526479,
 2,
 1139,
 {'1%': -3.4334108531807006,
  '5%': -2.862892168387536,
  '10%': -2.5674898285322496},
 -8273.914480099738)
(-25.304769346612073,
 0.0,
 1,
 1140,
 {'1%': -3.4334094211542983,
  '5%': -2.8628915360971003,
  '10%': -2.5674894918770197},
 83264.08934179449)

要强制statsmodels.tsa.stattools.adfuller使用所需的滞后数,您需要将maxlag参数设置为所需的滞后数,然后还将autolag参数设置为None以强制它使用作为maxlag作为数字传递的任何内容滞后而不是执行自动滞后顺序搜索例程。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM