Hi,

I am planning to forecast DAX data (German stock exchange index). I have downloaded data from Yahoo Finance. I use the formula

X.tmp<- read.csv("DAXz2016-2021wegmit0.csv",HEADER=TRUE)

x<- X.tmp$Close

n<- length(x)

xd<-100*diff(log(x))

nd<-n-1

time.nd<- as.Date(X.tmp$Date [1:nd]);

to get log-returns. After that I try to estimate a GARCH model using the log-return data.

o <- ugarchspec(variance.model =list(garchOrder=c(1,1)),mean.model=

list(armaOrder=c(0,0)));

o_fit <- ugarchfit(o,data=xd);

Sadly I just get the error message Error in if (mean(data) == 0) { : missing value where TRUE/FALSE needed . Unlike in many posts where the same problem existed, it shouldn´t be related to loops because my functions don´t have any loops.

The sample is given here, I guess the dates are not important to understand my post

Close

9851.349609

9887.94043

10046.61035

9965.509766

9794.639648

9822.080078

9563.360352

9624.509766

9530.620117

9622.259766

Does anyone know how to solve this problem?