Python Statsmodel ARIMA 启动 [平稳性]

Python Statsmodel ARIMA start [stationarity](Python Statsmodel ARIMA 启动 [平稳性])
本文介绍了Python Statsmodel ARIMA 启动 [平稳性]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我刚开始使用 statsmodels 进行时间序列分析.我有一个包含日期和值的数据集(大约 3 个月).我在为 ARIMA 模型提供正确顺序时遇到了一些问题.我希望根据趋势和季节性进行调整,然后计算异常值.

I just began working on time series analysis using statsmodels. I have a dataset with dates and values (for about 3 months). I am facing some issues with providing the right order to the ARIMA model. I am looking to adjust for trends and seasonality and then compute outliers.

我的价值观"不是固定的,statsmodel 说我必须要么诱导固定,要么提供一些差异以使其发挥作用.我玩弄了不同的顺序(没有深入了解改变 p、q 和 d 的后果).

My 'values' are not stationary and statsmodel says that I have to either induce stationarity or provide some differencing to make it work. I played around with different ordering (without understanding deeply about the consequences of changing p,q and d).

当我引入 1 进行差分时,我得到了这个错误:

When I introduce 1 for differencing, I get this error:

ValueError: The start index -1 of the original series has been differenced away

当我通过将我的订单设置为(比如)订单 = (2,0,1) 来消除差异时,我收到此错误:

When I remove the differencing by having my order as (say) order = (2,0,1), I get this error:

    raise ValueError("The computed initial AR coefficients are not "
ValueError: The computed initial AR coefficients are not stationary
You should induce stationarity, choose a different model order, or you can
pass your own start_params.
>>> 

任何关于如何诱导平稳性的帮助(或指向一个很好的教程的链接)都会有所帮助.还有,平稳性测试(例如,http://www.maths.bris.ac.uk/~guy/Research/LSTS/TOS.html)会很有用.

Any help on how to induce stationarity (or a link to a nice tutorial) would be helpful. And, also, tests of stationarity (like, http://www.maths.bris.ac.uk/~guy/Research/LSTS/TOS.html) would be useful.

更新:我正在阅读 ADF 测试:

Update: I am reading through ADF test:

http://statsmodels.sourceforge.net/stable/generated/statsmodels.tsa.stattools.adfuller.html

谢谢!警察局.

推荐答案

诱导平稳性:

  1. 去季节性(去除季节性)
  2. 去趋势(去除趋势)

有几种方法可以实现时间序列的平稳性 - Box-Cox 系列转换、差分等,方法的选择取决于数据.下面是常用的平稳性检验.

There are several ways to achieve stationarity of a time series - Box-Cox family of transformations, Differencing etc., Choice of method depends on the data. Below are the commonly used tests for stationarity.

平稳性检验:1. 增强的 Dickey-Fuller 测试2. KPSS测试KPSS python代码

Tests for stationarity: 1. Augmented Dickey-Fuller test 2. KPSS test KPSS python code

这篇关于Python Statsmodel ARIMA 启动 [平稳性]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Seasonal Decomposition of Time Series by Loess with Python(Loess 用 Python 对时间序列进行季节性分解)
Resample a time series with the index of another time series(使用另一个时间序列的索引重新采样一个时间序列)
How can I simply calculate the rolling/moving variance of a time series in python?(如何在 python 中简单地计算时间序列的滚动/移动方差?)
How to use Dynamic Time warping with kNN in python(如何在python中使用动态时间扭曲和kNN)
Keras LSTM: a time-series multi-step multi-features forecasting - poor results(Keras LSTM:时间序列多步多特征预测 - 结果不佳)
Python pandas time series interpolation and regularization(Python pandas 时间序列插值和正则化)