I am new to R and use the auto.arima function with xreg . I found the code on the network and tried to replicate the data. However, I get the following error messages:
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
My code is as follows:
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)
I read some answers to similar queries, but could not find a solution for my code. Please, help.
Hitesh
source share