【发布时间】:2020-05-30 05:39:20
【问题描述】:
信息:
我正在尝试预测比特币的价格,作为测试并使其更容易,在我数据中的最新日期时间后 1 天。所以 t = 2020 年 5 月 27 日,t + 1 = 2020 年 5 月 28 日。
所以我加载了我的数据:
x = pd.read_csv('btcdata.csv', header=0, parse_dates=['Date'], index_col=0)
close = x.Close
这就是它的样子.head():
Date
2020-05-27 8854.32
2020-05-26 8844.42
2020-05-25 8899.31
2020-05-24 8715.73
2020-05-23 9181.76
这里有个小问题,最近的日期位于顶部,最旧的日期位于底部。大多数日期都是按相反的方式组织的,至少 ARIMA 模型是这样看待的。
所以当我使用模型.forecast() 进行拟合和预测时,这就是我的output[0]:
[381.59648517]
这实际上与我的数据中的.tail() 更匹配:
Date
2014-12-05 377.1
2014-12-04 377.1
2014-12-03 378.0
2014-12-02 378.0
2014-12-01 370.0
问题/问题:
我该如何解决这个问题,并以某种方式对其进行排序,以便 ARIMA 模型知道我最近的日期t 并知道预测t + 1
而且每次我拟合我的模型时,都会出现这两个警告。它可能与问题有关:
ValueWarning: A date index has been provided, but it has no associated frequency information and so will be ignored when e.g. forecasting.
ValueWarning: A date index has been provided, but it is not monotonic and so will be ignored when e.g. forecasting.
【问题讨论】: