0

这是数据框(df)

         ds         y
1 2020-09-25 42,034.88
2 2020-09-24 41,806.37
3 2020-09-23 41,876.26
4 2020-09-22 41,828.91
5 2020-09-21 42,174.13

此数据的输入:

    structure(list(ds = structure(c(14613, 14614, 14615, 14616, 14617, 
14620, 14621, 14622, 14623, 14624, 14627, 14628, 14629, 14630, 
14631, 14634, 14635, 14636, 14637, 14638, 14641, 14642, 14643, 
14644, 14648, 14649, 14650, 14651, 14652, 14655, 14656, 14657, 
14658, 14659, 14662, 14663, 14664, 14665, 14666, 14669, 14670, 
14671, 14672, 14673, 14676, 14677, 14678, 14679, 14680, 14683, 
14684, 14685, 14686, 14687, 14690, 14692, 14693, 14694, 14697, 
14698, 14699, 14700, 14701, 14704, 14705, 14706, 14707, 14708, 
14711, 14712, 14713, 14714, 14715, 14718, 14719, 14720, 14721, 
14722, 14725, 14726), class = "Date"), y = c(9437.85, 9657.38, 
9727.36, 9737.47, 9776.21, 9797, 9778.36, 9784.85, 9802.45, 9923.14, 
9895.46, 9954.41, 9904.74, 9753.84, 9774.07, 9689.2, 9666.48, 
9603.55, 9579.81, 9614.19, 9591.5, 9595.24, 9627.63, 9769.73, 
9809.98, 9786.46, 9733.36, 9802.8, 9805.87, 9701.81, 9769.68, 
9867.09, 9889.3, 9902.62, 9953.07, 9823.57, 9686.18, 9667.17, 
9657.79, 9498.56, 9546.38, 9419.43, 9511.53, 9626.29, 9740.19, 
9787.03, 9784.98, 9879.7, 10025.99, 10088.45, 10017.71, 9981.48, 
10007.87, 10000.93, 9963.35, 10146.27, 10127.03, 10137.93, 10056.46, 
10073.76, 10178.43, 10246.77, 10416.51, 10447.84, 10419.82, 10523.01, 
10533.57, 10586.46, 10557.19, 10506.2, 10570.88, 10677.47, 10659.21, 
10669.88, 10641.52, 10590.21, 10615.15, 10607.03, 10556.37, 10556.38
)), row.names = 2663:2584, class = "data.frame")

为 Prophet 预测尝试的代码:

  try <- prophet(df)
  future <- make_future_dataframe(try, periods = 31, freq = "day")
  forecast <- predict(try,future)

先知的错误

if (m$y.scale == 0) { 中的错误:需要 TRUE/FALSE 的缺失值另外:警告消息:在 setup_dataframe(m,history,initialize_scales = TRUE) 中:

为华宇尝试的代码(数据从 4 月 4 日开始,缺少周末,中间可能缺少一两天,如公共假期或无交易):

x = ts(df$y, start = c(2010,1,4), frequency = 365)
arima1 = auto.arima(x)
forecast1 = forecast(arima1,h = 31)

Auto Arima 中的错误:

stats::arima(x = x, order = order,seasonal =season, include.mean = include.mean, : 'x' must be numeric 另外:警告消息:在 is.constant(x) 中:引入了 NA通过胁迫

有什么建议吗?

4

0 回答 0