简体   繁体   中英

Getting error while estimating ARIMA models using python (for d>2)

I am trying to fit an ARIMA model using Python. It has two columns. First- date and second- confirmed orders. Here are first few rows from the data file (daily data of confirmed orders from March 14, 2020 to April 14, 2020):

数据

My codes are working well as long as number of differences (d) is 2 or less. When d>2, then I get an error " raise ValueError("d > 2 is not supported").

Here is the code that I am using:

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from statsmodels.tsa.stattools import adfuller
from statsmodels.tsa.seasonal import seasonal_decompose
from statsmodels.tsa.arima_model import ARIMA
from pandas.plotting import register_matplotlib_converters
from pandas import read_csv
from pandas import DatetimeIndex
from datetime import datetime
register_matplotlib_converters()

df = pd.read_csv('order.csv',parse_dates = ['date'], index_col = ['date'])
df.info()

#Declare that data are collected on daily basis
df.index.freq = 'd'

#ARIMA
model = ARIMA(df,order=[1,4,1], freq='D')
model_fit = model.fit(disp=0)
print(model_fit.summary())

The screenshot of the error is also attached for details. Any help on solving this will much appreciated. Thanks in advance.

截屏

Maybe d>2 is not allowed means our best bet is to start simple, check if integrating once grants stationarity. If so, we can fit a simple ARIMA model and examine the ACF of the residual values to get a better feel about what orders of differencing to use. Also a drawback, if we integrate more than two times (d>2), we lose n observations, one for each integration. And one of the most common errors in ARIMA modeling is to "overdifference" the series and end up adding extra AR or MA terms to undo the forecast damage, so the author (I assume) decides to raise this exception.

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