maximize GARCH model, variance equation

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
jeanne
Posts: 11
Joined: Tue Jul 23, 2013 6:42 am

maximize GARCH model, variance equation

Unread post 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
Last edited by jeanne on Tue Oct 01, 2013 7:03 am, edited 2 times in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: maximize GARCH model, variance equation

Unread post 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.
jeanne
Posts: 11
Joined: Tue Jul 23, 2013 6:42 am

Re: maximize GARCH model, variance equation

Unread post 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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: maximize GARCH model, variance equation

Unread post 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.
jeanne
Posts: 11
Joined: Tue Jul 23, 2013 6:42 am

Re: maximize GARCH model, variance equation

Unread post 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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: maximize GARCH model, variance equation

Unread post by TomDoan »

Did you check your data? If I take your program, generate random data and take out the constraint, it works fine.
Post Reply