我是 R 新手,并且可以auto.arima
使用xreg
. 我在网上找到了一个代码,并试图复制我的数据。但是,我收到以下错误消息:
Error in optim(init[mask], armaCSS, method = optim.method, hessian = FALSE, :
non-finite value supplied by optim
Error in if (diffs == 1 & constant) { : argument is of length zero
In addition: Warning message:
In auto.arima(salesTS, xreg = xreg1) : Unable to calculate AIC offset
我的代码如下:
data <- read.csv("C:/Users/s.karkala.rao/Documents/Projects/ad-hoc/Hitesh/forARIMAX.csv", header=TRUE, stringsAsFactors=TRUE)
subdata <- subset(data, data$NG.code == "101451")
subdata <- subdata[, -1]
salesTS <- ts(subdata$Sales.Qty, frequency=7)
xreg1 <- subdata[,-1]
xreg1 <- xreg1[, -10]
xreg1 <- as.matrix(xreg1)
model <- auto.arima(salesTS, xreg=xreg1)
我已经阅读了类似查询的一些答案,但无法找出我的代码的解决方案。请帮忙。