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
Code: Select all
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
