0
votes

I'm fitting an arima with xreg:

arima(temp_ts, order = c(1,1,1), seasonal = list(order = c(0,1,0), period = 12),
  xreg = temp_xreg, method="CSS")

And it reported error:

Error in optim(init[mask], armaCSS, method = optim.method, hessian = TRUE,  : 
  non-finite value supplied by optim

I tried adding:

arima(temp_ts, order = c(1,1,1), seasonal = list(order = c(0,1,0), period = 12),
  xreg = temp_xreg, method="CSS", optim.method = "L-BFGS-B"))

arima(temp_ts, order = c(1,1,1), seasonal = list(order = c(0,1,0), period = 12),
  xreg = temp_xreg, method="CSS", optim.method = "Nelder-Mead"))

But nothing works. Always the same error!

I even tried to add a

"hessian = FALSE"

But it returned the same error with an extra warning:

  unused argument (hessian = FALSE)
1
Welcome to SO! Please make your code example runnable so that we can reproduce your error per the MCVE requirements stackoverflow.com/help/mcve You may wish to use a builtin data set. Or dput(temp_ts) if it is small. Anyway, this is most likely a data issue. - Hack-R
Hi Hack-R, I ran some quick data sanity check but it doesn't appear to be a data quality issue: temp_ts> length(temp_ts) [1] 156 > dim(temp_xreg) [1] 156 2 > sum(is.na(temp_xreg)) [1] 0 > sum(is.na(temp_ts)) [1] 0 - Chenying Gao
Glad to hear it. I would still recommend to provide a reproducible example; it's technically required and also just really helps us help you. This most famous R question on this site will help you with this: stackoverflow.com/questions/5963269/… This seems annoying and unnecessary when you are new, but becomes easy and makes sense once you gain experience. - Hack-R

1 Answers

0
votes

I had the exact same issue when fitting an Arima model and introducing xreg with seven one hot variables: the days of the week. I solved it just by eliminating one of the days (sunday in my case), so that the other fields are not determined between each other.