为什么在运行 ADF 测试时会出现 MemoryError? [英] Why I get MemoryError when I run ADF test?

查看:38
本文介绍了为什么在运行 ADF 测试时会出现 MemoryError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的时间序列:

<预><代码>数据 z_data zp_data时间2018-01-01 00:00:00 -0.045988 NaN NaN2018-01-01 00:01:00 -0.046024 NaN NaN2018-01-01 00:02:00 -0.044360 NaN NaN2018-01-01 00:03:00 -0.044722 NaN NaN2018-01-01 00:04:00-0.043637 NaN NaN…………2018-12-12 23:55:00 11.454639 0.088124 1.6317362018-12-12 23:56:00 11.498422 0.935382 2.5517532018-12-12 23:57:00 11.521695 1.251496 1.2239492018-12-12 23:58:00 11.476974 0.244583 -0.0122732018-12-12 23:59:00 11.480120 0.278023 0.015562[498240 行 x 3 列]

我使用了增强型 Dickey-Fuller 测试.该测试用于评估时间序列是否平稳.但我得到了 MemoryError.我该如何解决这个问题?

解决方案

autolag 正在浪费内存,因为它在滞后搜索期间将所有完整模型保留在内存中.

参见 https://github.com/statsmodels/statsmodels/issues/1849

一些可能的解决方法是

  • 修复滞后次数并避免自动滞后搜索,或
  • 限制滞后次数,设置 maxlag,为滞后搜索评估

这在设计时并没有真正考虑到大的时间序列.

This is my Timeseries:


                          data    z_data   zp_data
time                                              
2018-01-01 00:00:00  -0.045988       NaN       NaN
2018-01-01 00:01:00  -0.046024       NaN       NaN
2018-01-01 00:02:00  -0.044360       NaN       NaN
2018-01-01 00:03:00  -0.044722       NaN       NaN
2018-01-01 00:04:00  -0.043637       NaN       NaN
                        ...       ...       ...
2018-12-12 23:55:00  11.454639  0.088124  1.631736
2018-12-12 23:56:00  11.498422  0.935382  2.551753
2018-12-12 23:57:00  11.521695  1.251496  1.223949
2018-12-12 23:58:00  11.476974  0.244583 -0.012273
2018-12-12 23:59:00  11.480120  0.278023  0.015562
[498240 rows x 3 columns]


I used the Augmented Dickey-Fuller Test. This test is used to assess whether or not a time-series is stationary. but I get the MemoryError. How can I solve this issue?

解决方案

autolag is wasting memory because it keeps all full models in memory during the lag search.

see https://github.com/statsmodels/statsmodels/issues/1849

Some possible workarounds are to either

  • fix the number of lags and avoid the automatic lag search, or
  • limit the number of lags, set maxlag, that are evaluated for the lag search

This wasn't really designed with large time series in mind.

这篇关于为什么在运行 ADF 测试时会出现 MemoryError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆