Chenying Gao
Chenying Gao

Reputation: 310

Fitting arima, Error in optim, non-finite value supplied by optim

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)

Upvotes: 0

Views: 4321

Answers (1)

Jose Acién
Jose Acién

Reputation: 1

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.

Upvotes: 0

Related Questions