TransWikia.com

ndiffs for Python

Data Science Asked by S__A_a_r_ on January 22, 2021

Is there a function equivalent of R‘s ndiffs function in Python?
It is used to estimate a number of diffs for creating stationary time-series.

R Documentation

2 Answers

There is a function implemented in pmdarima that can help you finding the number of diffs.

The function is called pmdarima.arima.ndiffs

Correct answer by vpz on January 22, 2021

I am not sure if there any is any library that can directly make your data stationary in python. However, you can plot your time series, which will visually tell you the components such as trend and seasonality of your data.

using statsmodel you can take each a look at each component of a time-series like this,

trend = decomposition.trend
seasonal = decomposition.seasonal 
residual = decomposition.residual

After this you can use shift function to make your time-series stationary by taking off trend and seasonality.

Refer to this tutorial, which has in detail to make your time-series stationary based on your data. Hope this helps.

Answered by i.n.n.m on January 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP