Page 1 of 1

maximize GARCH model, variance equation

Posted: Wed Sep 25, 2013 4:43 am
by jeanne
Dear all,

I am estimating GARCH models using the MAXIMIZE command as I need to include a dummy variable and an additional control index in my variance equation.

***************************************************************************************************************************

Code: Select all

clear(ALL)
open data "xxx"
data(for=xls,org=col)

** preliminary GARCH to get MSCI variance
garch(p=1,q=1, regressors, hseries=mscivar) / msci
# constant msci{1}

nonlin(parmset=meanparms) alpha_0 alpha_1 alpha_2
nonlin(parmset=garchparms) gamma_D gamma_0 gamma_1 gamma_2 gamma_3

*** mean equation
frml resid = spotret - alpha_0

*** regression for initial values
linreg(noprint) spotret / u
# constant spotret{1} mscivar{1}

compute alpha_0=%beta(1), alpha_1=%beta(2), alpha_2=%beta(3)

**** conditional variance equation
set h = %seesq
set u = %seesq

compute gamma_D=0.05,gamma_0=%seesq,gamma_1=0.04,gamma_2=0.05, gamma_3=0.05

frml varf =(1+gamma_D*futdum)*(gamma_0 + gamma_1*h{1} + gamma_2*u{1}**2 + gamma_3*mscivar{1})

*** log-likelihood function
frml logl = (h(t)=varf(t)),u(t)=resid(t),%logdensity(h,u)

*** maximize routine
maximize(parmset=meanparms+garchparms,method=bfgs,recursive,iters=1000) logl 3 *

**********************************************************************************************************************************
Every time I estimate it, I get the following:
## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points

When I run this set up without the “gamma_3*mscivar{1}” – part, it works fine, so I suspect the problem to be in there…

Any ideas why that might be?
I greatly appreciate any help, suggestions or comments...

Thank you very much!
Jeanne

Re: maximize GARCH model, variance equation

Posted: Wed Sep 25, 2013 10:44 am
by TomDoan
It would be much more helpful to see what doesn't work than what does. It should be a straightforward extension of what you have. The only thing offhand that I could see going wrong is if the "10" as the start period on the MAXIMIZE isn't right since you'll lose entries for lags of the MSCI variance.

BTW, if you post a large block of code, please use the "Code" button to enclose it. It makes the post much easier to read.

Re: maximize GARCH model, variance equation

Posted: Mon Sep 30, 2013 2:44 am
by jeanne
That is very true - I am sorry for this and edited my first post to include what does NOT work.
Thank you very much!

Re: maximize GARCH model, variance equation

Posted: Mon Sep 30, 2013 9:57 am
by TomDoan
What's CONSTRAINT? That isn't included.

If it doesn't work when you add the MSCIVAR{1} term, have you checked where MSCIVAR is defined? If it isn't defined from entry 2 on, then the GARCH recursion won't work. If MSCI isn't defined from entry 1, then MSCIVAR won't be defined until at least 3.

Re: maximize GARCH model, variance equation

Posted: Tue Oct 01, 2013 7:08 am
by jeanne
That was a left-over from an old model - sorry. I tried without it but still get the same error message.
When I replace the variance of the msci index with its spotreturn, I also get the same error message. Even trying to start at observation 10 instead of 2 or 3 does not help.
However, when I include the main dependent variable of the model, spotret (return of some other index), the maximize command works fine.
Could it then be the problem of the variable itself and not my model set-up?
Maybe there is not enough variance in the msci-variable???
Is there anything I could do to still include it?

Re: maximize GARCH model, variance equation

Posted: Tue Oct 01, 2013 8:39 am
by TomDoan
Did you check your data? If I take your program, generate random data and take out the constraint, it works fine.