Dear all:

I have a garch equation different from the traditional one:

 y(t)=b1+b2*x(t) + sqrt(h(t))*z(t), where z(t)~N(0,1)  h(t)=b3+b4*h(t-1)+b5*(
z(t-1)-b6*sqrt(h(t-1) )^2

I tried to use optim to estimate the six parameters:

garch <- function(b,x,y){
         b1<-b[1]
         b2<-b[2]
         b3<-b[3]
         b4<-b[4]
         b5<-b[5]
         b6<-b[6]
         N<-length(y)
         lkhd<-0
         ht<-var(y)
         for (i in 1:N){
                zt<-y[i]-b1-b2*x[i]
                ht<-b3+b4*(ht)^2+b5*(zt/sqrt(ht)-b6*sqrt(ht))^2
                lkhd<-lkhd +log(ht)+zt^2/ht
                }
        return(lkhd)
}
optim(c(0.01,0.2,0.2,0.2,0.2,0.2),method="BFGS",fn=garch,
    x=data.x,y=data.y)

However, I got the following warnings:
In log(ht) : create NaNs
In sqrt(ht) : create NaNs
........................

Can anyone help me interpreting these warnings? Are there any other better
way to estimate the parameters? Thank you very much.

ShyhWeir

	[[alternative HTML version deleted]]

