0

I am trying to fit and ARIMAX model.

fit_ARIMAX = auto.arima(
  y = df_ARIMAX_train[,"Y"], 
  xreg = df_ARIMAX_train[, c("X1", "X2"],
  ic = "aic",
  trace = TRUE,
  stepwise = FALSE,
  seasonal = TRUE, 
  approximation = F,
  parallel = T)

However, I get the error saying

Error in svd(na.omit(cbind(rep(1, NROW(xregg)), xregg))) : infinite or missing values in 'x'

This error is strange as neither Y, X1 nor X2 has infinite or missing values. X1 and X2 have values ranging from -1 to 2, and Y have values ranging from -3000 to 3000.

I suspect maybe the error occurs because there are values that are close to 0 in X1 and X2 with the closest one being 0.001.

The head of X1 and X2 are as below.

                        X1                            X2
2009-07-01 09:00:00 "-1.267407986"               "-0.450787928"               
2009-10-01 09:00:00 "-0.444757134"               "-0.895386200"               
2009-12-31 09:00:00 " 0.085217004"               "-0.428108562"               
2010-03-31 09:00:00 " 1.081145048"               " 0.377983714"               
2010-07-01 09:00:00 " 0.316444426"               " 0.739781358"               
2010-10-01 09:00:00 " 0.339667669"               " 0.150974178"               
2010-12-31 09:00:00 " 0.031399744"               " 0.082819323"               
2011-03-31 09:00:00 "-0.297106239"               "-0.546456325"               
2011-07-01 09:00:00 " 0.460055713"               " 0.321268437"               
2011-10-01 09:00:00 " 0.005808752"               " 0.181882363" 

I would really appreciate it if anyone could tell me why the error appears.

Thanks,

Umi
  • 7
  • 3
  • Looks like you are missing a ) in the xreg argument. After "X2". – xilliam May 24 '21 at 07:50
  • Another thing is that `X1` and `X2` seem to be character vectors, not numeric vectors. The funcion only works with numeric values. If you read in external data, then that usually means that at least one of the fields contains a character that is not part of a number (e.g. a letter). – slamballais May 24 '21 at 07:52

0 Answers0