创建Arima模型时获得直线

发布于 2025-01-24 13:36:17 字数 722 浏览 5 评论 0原文

我有一个192.405值(火车+测试值)的风扇速度(RPM)数据集。我正在训练Arima模型,并试图预测数据集的其余值并比较结果。

在将模型拟合到测试数据中,我对预测进行直线直线,

from sklearn.model_selection import train_test_split 
from statsmodels.tsa.arima_model import ARIMA

dfx = df[(df['Tarih']>'2020-07-23') & (df['Tarih']<'2020-10-23')]

X_train = dfx[:int(dfx.shape[0]*0.8)] #2 months
X_test = dfx[int(dfx.shape[0]*0.8):] # rest, 1 months

model = ARIMA(X_train.Value, order=(4,1,4))
model_fit = model.fit(disp=0)
print(model_fit.summary())

test = X_test
train = X_train

我现在该怎么办?

I have a Fan Speed (RPM) dataset of 192.405 Values (train+test values). I am training the ARIMA model and trying to predict the rest of the future values of our dataset and comparing the results.

While fitting the model in test data I am getting straight line for predictions

from sklearn.model_selection import train_test_split 
from statsmodels.tsa.arima_model import ARIMA

dfx = df[(df['Tarih']>'2020-07-23') & (df['Tarih']<'2020-10-23')]

X_train = dfx[:int(dfx.shape[0]*0.8)] #2 months
X_test = dfx[int(dfx.shape[0]*0.8):] # rest, 1 months

model = ARIMA(X_train.Value, order=(4,1,4))
model_fit = model.fit(disp=0)
print(model_fit.summary())

test = X_test
train = X_train

What could i do now ?

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌化 2025-01-31 13:36:17

您的Arima模型使用最后4个观测值来做出预测。第一个预测将基于最后四个已知数据点。第二个预测将基于第一个预测和最后三个已知数据点。第三个预测将基于第一个和第二个预测以及最后两个已知数据点等。您的第五个预测将完全基于预测值。一百个预测将基于基于预测值的预测值基于预测值……每个预测都会与实际值略有偏差。这些预测错误会随着时间的流逝而累积。当您尝试预测如此大的视野时,这通常会导致Arima仅预测一条直线。

如果您的模型使用MA组件,以Q参数表示,则您只能预测未来的Q步骤。这意味着您的模型只能预测接下来的四个数据点,此后,预测会收敛到直线。

Your ARIMA model uses the last 4 observations to make a prediction. The first prediction will be based on the four last known data points. The second prediction will be based on the first prediction and the last three known data points. The third prediction will be based on the first and second prediction and the last two known data points and so on. Your fifth prediction will be based entirely on predicted values. The hundredth prediction will be based on predicted values based on predicted values based on predicted values … Each prediction will have a slight deviation from the actual values. These prediction errors accumulate over time. This often leads to ARIMA simply prediction a straight line when you try to predict such large horizons.

If your model uses the MA component, represented by the q parameter, then you can only predict q steps into the future. That means your model is only able to predict the next four data points, after that the prediction will converge into a straight line.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文