Data is downloaded as below:
prices <- getSymbols(symbols,
src = 'yahoo',
from = "2019-04-12",
auto.assign = TRUE,
warnings = FALSE) %>%
map(~Ad(get(.))) %>%
reduce(merge) %>%
colnames<-(symbols)
Then converted to differenced data:
p <- dailyReturn(prices$SPY, type = "log")
q <- dailyReturn(prices$IWM, type = "log")
then I am trying to do a simple auto.arima and autoplot forecast:
sp_ts <- as.ts(prices$SPY)
#ts_ts(stk_rtns)
sp_ts %>%
auto.arima()%>%
forecast(h =10)%>%
autoplot()
Error in if (object$spec$constant) { : argument is of length zero
I am unable to solve, there is no solutions on stack overflow, the problem is with the forecast command it presents inverse AR and MA charts which are completey useless.
