![](/img/trans.png)
[英]Getting error while estimating parameter for a battery using GEKKO in python
[英]Getting error while estimating ARIMA models using python (for d>2)
我正在嘗試使用 Python 安裝 ARIMA model。 它有兩列。 第一個日期和第二個確認的訂單。 以下是數據文件中的前幾行(2020 年 3 月 14 日至 2020 年 4 月 14 日已確認訂單的每日數據):
只要差異數 (d) 為 2 或更少,我的代碼就運行良好。 當 d>2 時,我得到一個錯誤“raise ValueError("d > 2 is not supported")。
這是我正在使用的代碼:
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())
還附上了錯誤的屏幕截圖以獲取詳細信息。 任何有關解決此問題的幫助將不勝感激。 提前致謝。
也許 d>2 是不允許的,這意味着我們最好的選擇是從簡單的開始,檢查一次積分是否具有平穩性。 如果是這樣,我們可以擬合一個簡單的 ARIMA model 並檢查殘差值的 ACF,以更好地了解要使用的差分順序。 還有一個缺點,如果我們積分超過兩次(d>2),我們會丟失 n 個觀察值,每次積分一個。 ARIMA 建模中最常見的錯誤之一是“過度差分”序列並最終添加額外的 AR 或 MA 項來撤銷預測的損害,因此作者(我假設)決定提出這個例外。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.