简体   繁体   English

ARIMA Model 为我的温度数据预测一条直线

[英]ARIMA Model Predicting a straight line for my temperature data

I have a temperature dataset of 427 days(daily temperature data) I am training the ARIMA model for 360 days and trying to predict the rest of the 67 days data and comparing the results.我有一个 427 天的温度数据集(每日温度数据)我正在训练 ARIMA model 360 天并尝试预测 67 天数据的 rest 并比较结果。 While fitting the model in test data I am just getting a straight line as predictions, Am i doing something wrong?在测试数据中拟合 model 时,我只是得到一条直线作为预测,我做错了什么吗? ` `

from statsmodels.tsa.arima.model import ARIMA
model = ARIMA(train['max'],order=(1,1,2),)
results = model.fit()
results.summary()
start = len(train)
end = len(train) + len(test) -1
predictions= pd.DataFrame()
predictions['pred'] = results.predict(start=start, end=end, typ='levels').rename('ARIMA(1,1,1) Predictions')

在此处输入图像描述

Your ARIMA model uses the last two observations to make a prediction, that means the prediction for t(361) is based on true values of t(360) and t(359).您的 ARIMA model 使用最后两个观察值进行预测,这意味着 t(361) 的预测基于 t(360) 和 t(359) 的真实值。 The prediction of t(362) is based on the already predicted t(361) and the true t(360). t(362) 的预测基于已经预测的 t(361) 和真实的 t(360)。 The prediction for t(363) is based on two predicted values t(361) and t(360). t(363) 的预测基于两个预测值 t(361) 和 t(360)。 The prediction is based on previous predictions, and that means that forecasting errors will negatively impact new predictions.该预测基于先前的预测,这意味着预测错误将对新预测产生负面影响。 The prediction for t(400) is based on predictions that are based on predictions that are based on predictions etc. Imagine your prediction deviates only 1% for each time step, the forecasting error will become bigger and bigger the more time steps you try to predict. t(400) 的预测是基于基于预测等的预测的预测。想象一下,您的预测每个时间步长仅偏离 1%,预测误差将变得越来越大,您尝试的时间步长越多预测。 In such cases the predictions often form a straight line at some point.在这种情况下,预测通常会在某个点形成一条直线。

If you use and ARIMA(p, d, q) model, then you can forecast a maximum of q steps into the future.如果您使用 ARIMA(p, d, q) model,那么您最多可以预测未来 q 步。 Predicting 67 steps into the future is a very far horizon and ARIMA is most likely not able to do that.预测未来的 67 步是一个非常遥远的范围,而 ARIMA 很可能无法做到这一点。 Instead, try to predict only the next single or few time steps.相反,尝试仅预测下一个或几个时间步长。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM