R中的ARIMA预测值相同 [英] Same values for ARIMA forecasts in R

查看:583
本文介绍了R中的ARIMA预测值相同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用ARIMA预测R中的股价.我正在使用auto.arima函数来拟合我的模型.每次尝试执行此操作时,我都会得到与预测值相同的值.我尝试使用不同的股票,但在每种情况下都会发生相同的情况.在这里,我尝试了预测苹果价格:

I am trying to do forecasting of stock prices in R using ARIMA. I am using the auto.arima function to fit my model. Every time I'm trying to do that I get the same value for the forecasted values. I tried using different stocks but the same thing happens in every case. Here I tried forecasting apple prices:

arimapple<-ts(appletrain,start = timedata [1])

arimapple <- ts(appletrain, start = timedata[1])

fitappletrain<-auto.arima(arimapple)

fitappletrain <- auto.arima(arimapple)

fitappletrain

fitappletrain

forecastapple<-预测(fitappletrain,h = 57)

forecastapple <- forecast(fitappletrain, h=57)

forecastapple

forecastapple

我得到的输出如下:

 Point       Forecast  Lo 80    Hi 80    Lo 95    Hi 95
17763         180.94 176.7350 185.1450 174.5090 187.3710
17764         180.94 174.9932 186.8868 171.8451 190.0349
17765         180.94 173.6567 188.2233 169.8011 192.0789
17766         180.94 172.5299 189.3501 168.0779 193.8021
17767         180.94 171.5373 190.3427 166.5598 195.3202
17768         180.94 170.6398 191.2402 165.1872 196.6928
17769         180.94 169.8145 192.0655 163.9251 197.9549
17770         180.94 169.0464 192.8336 162.7503 199.1297
17771         180.94 168.3249 193.5551 161.6469 200.2331

,依此类推,因此我收到的每个预测都是180.94.我该如何解决?

and so on, so every forecast I receive is 180.94. How can I solve this?

推荐答案

我认为您的数据不包含任何强烈的季节性和趋势,我认为 您的历史数据也较少,因此auto.arima()无法准确找到预测.

I think your data does not contain any strong seasonality and trend and i think your historical data is also less, the auto.arima() is not able to find forecast accurate because of that.

因此,它只是将您的历史数据取平均值并作为预测返回. 因此值是相同的(绘制时会得到直线.)

Therefore it is simply taking average of your historical data and returning as forecast. therefore the values are same (you will get straight line when you plot it.)

这篇关于R中的ARIMA预测值相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆