Page 1 of 1

GARCH estimation by ML

Posted: Mon Apr 27, 2009 11:04 am
by u-gane
Dear moderators,
Please help, I have to estimate the following GARCH model by ML
R(t) = m + var(t)*z(t), z(t) = N(0,1)
var(t) = w + a*(R(t-1)-Q*var(t-1)^0.5)^2 + b*var(t-1)
The starting value for var should be equal to the conditional expectation which is var1 = w/(1-a-a*Q^2-b). However, when I run the program for ML estimation (it is presented below) it gives me the following error message "missing values in @Logl series at current coefficients at observation 2 in "DO_LL1.ML". I thought that the problem was in the starting value for var1, so I recalculated everything with some var1 = 0.2, and I received another error message "missing values in @Logl series at current coefficients at observation 2 in "DO_LL1.ML". Please, help to correct the program. On the first stage the program generates the series R with some given parameters, on the second stage it takes the series generated and estimates the parameters that miximize the Logl. Can you pls also advise how to program restrictions on the coeficients: for example, I want all the coefficients in VAR equation to be greater than zero
Thank you smpl @first @first
series var = 0.2
series r = 0
series u = 0
smpl 2 500
series u = nrnd
series var = 0.01 + 0.9*var(-1) + 0.05*var(-1)*(u(-1))^2
series r = u*(var)^0.5
coef(5) b
smpl @first @first
series var1 = b(2)/(1 - b(3) - b(3)*b(4)^2 - b(5))
smpl 2 500
logl ll1
ll1.append @logl logl
ll1.append @param b(1) 0 b(2) 0.01 b(3) 0.05 b(4) 0 b(5) 0.9
ll1.append var1 = b(2) + b(3)*(r(-1) - b(4)*var1(-1)^0.5)^2 + b(5)*var1(-1)
ll1.append res = r/var1 - b(1)/var1
ll1.append logl = log(@dnorm(res/@sqrt(var1)))
ll1.ml
show ll1.output

Re: GARCH estimation by ML

Posted: Thu Apr 30, 2009 3:31 pm
by trubador
There are several mistakes in your model. First, you should add a bracket in your simulated var equation (i.e. (var(-1)*u(-1))^2). Second, you misspecified the likelihood and divided the resiudals twice with the conditional variance. Third, although you have written an equation for it, the initial value of var1 still equals 0, since you define b coefficient vector later inside the logl object. However, these have only minor effects and your actual problem seems to be the starting values. The model is nonlinear and the random component plays an important role in the model dynamics. You may wish to use smaller random values and diminish their impact (for instance u=0.1*nrnd). Otherwise, you should not expect the estimated parameter values to be statistically equal to their original simulated values. I suggest you to supply different initial points to estimate feasible parameter values and to ensure the convergence of the estimation process. The following link may also be helpful:

http://forums.eviews.com/viewtopic.php? ... 2611#p2611