I am modeling daily orders with seasonality using vector auto-regressive model with exogenous variables. I used the 'vars' package which has functions to fit the model. I got predictions without using exogenous variables but I must include them. When I included them, my predictions came up as NAs. I don't understand why this is happening. My matrix of exogenous variables includes marketing information and plenty of zeros and ones. It is a 1218 x 123 size matrix. My endogenous variables is a 1218 x 4 size matrix. R code below. I really need help on how to fix this problem with my predictions.
final<-merge.zoo(regresseditems, powers, lags)
final<-as.matrix(final)
final[is.na(final)] <- 0
x1<-final[5:1222,]
vardata<-merge.zoo(Total_Orders.ts,prospects_orders.ts,house_orders.ts,
Email_Transactions.ts)
jaba<-as.matrix(vardata)
lambda <- BoxCox.lambda(na.contiguous(jaba))
VARlnorders<-BoxCox(jaba, lambda)
vardatest<-VAR(VARlnorders, p = 123 , type ="both", season =366, exogen=x1)
predictions <-predict(vardatest, n.ahead=254,dumvar=x2)
(x2 is a 254 x 123 reduced size matrix of the same exogenous variables. n.ahead must equal the number of observations in x2)
$prospects_orders.ts
fcst lower upper CI
[1,] NA NA NA 0.9641635
[2,] NA NA NA 1.1487698
[3,] NA NA NA 1.3001178
[4,] NA NA NA 1.4754121
[5,] NA NA NA 1.5504319
[6,] NA NA NA 1.6052040
[7,] NA NA NA 1.6545732