GARCH-M and rolling

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.
victor
Posts: 15
Joined: Sat Jul 31, 2010 4:15 pm

GARCH-M and rolling

Unread post by victor »

Hello,

I am using code for rolling regression for GARCH given in user manual to estimate GARCH-M. Please see if I have done everything in correct way. I am getting the outputs and graphs. I have done following things:

I have added %garchv to make it GARCH-M

I have changed coeff (2) to (3), (3) to (4), and (4) to (5)

Also, at the end I want to collect estimation of GARCH-V and window date in each estimation in two columns. How can I do that?

Thanks

Victor

0000000000000

Code: Select all

CALENDAR(M) 1997:07
DATA(FORMAT=XLS,ORG=COLUMNS) 1997:07 2012:07 STK


table

compute width=50
dec vect[series] coeffs(5)
clear coeffs
do gend=width,180
if gend==width
garch(p=1,q=1,regressors) gend-width+1 gend STK
#constant %garchv

else
garch(p=1,q=1,initial=%beta,hessian=%xx,regressors) $
gend-width+1 gend STK
#constant %garchv

compute %pt(coeffs,gend,%beta)
end do gend

spgraph(vfields=3,samesize,$
footer="Rolling GARCH Estimates, Window Width = 50")
set lrstd = sqrt(coeffs(3)/(1-coeffs(4)-coeffs(5)))
graph(hlabel="Estimated Process Standard Deviation",min=0.0)
# lrstd width *
graph(hlabel="Lagged Variance Coefficient")
# coeffs(5) width *
graph(hlabel="Lagged Squared Residuals Coefficient")
# coeffs(4) width *
spgraph(done)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GARCH-M and rolling

Unread post by TomDoan »

That looks correct. Wouldn't

print / coeffs(2)

give you what you want for the GARCH-V coefficients?
victor
Posts: 15
Joined: Sat Jul 31, 2010 4:15 pm

Re: GARCH-M and rolling

Unread post by victor »

That works. Thanks
victor
Posts: 15
Joined: Sat Jul 31, 2010 4:15 pm

Re: GARCH-M and rolling

Unread post by victor »

Problem 1 - I am also running a very big data program similar to above (on Rats 8.2ver). How can I collect coeff (2), convergence result(1/0.1), and Significance for coeff (2) in three columns.

Problem 2 - When I run same code on Rats 8.3 version I get absolutely different results, many zeros, no convergence, different values...What I am missing?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GARCH-M and rolling

Unread post by TomDoan »

What is your data series? Have you tried running a full sample GARCH with diagnostic tests?
victor
Posts: 15
Joined: Sat Jul 31, 2010 4:15 pm

Re: GARCH-M and rolling

Unread post by victor »

May be my question was no precise, for the code given above and data set attached I am getting very different result for Rats ver 8.2 and ver 8.3. Am I missing some sort of patch etc.? When I run simple garch-m (no rolling) both versions (8.2 and 8.3) converge giving same result.

For the same code and data attached I also need to collect coeff (2), convergence result(1/0.1), and Significance for coeff (2) in three columns side by side. This is because I plan to run even a bigger data set in future.
Attachments
Data.xls
(35.5 KiB) Downloaded 719 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GARCH-M and rolling

Unread post by TomDoan »

You're trying to fit a rolling GARCH model with very short windows to data which don't really show much of a GARCH effect. This is the result of a test for ARCH on the first 50 data points:

Test for ARCH in STK
Using data from 1997:07 to 2001:08

Lags Statistic Signif. Level
4 0.439 0.77996

As it says in the User's Guide, the estimates will get quite unstable if you hit an outlier after a quiet period. Different versions of RATS use different guess values, but neither one is going to give a set of sensible results if asked to fit a model that doesn't work.
victor
Posts: 15
Joined: Sat Jul 31, 2010 4:15 pm

Re: GARCH-M and rolling

Unread post by victor »

print / coeffs(2) %CONVERGED (2) %TSTATS(2)

I am getting error when I run above command.

How can I collect coeff (2), convergence result(1/0.1), and Significance for coeff (2) in three columns side by side?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GARCH-M and rolling

Unread post by TomDoan »

%CONVERGED is a scalar (for the entire model, not coefficient by coefficient) and you're not saving it anywhere. You would need to do something like this:

add

clear(zeros) convhist

before the loop

then

compute convhist(gend)=%converged

after the GARCH inside the loop. You can then print out the convhist series.

Given how few data points you have in the segments, you're probably better off using the full sample GARCH estimates as your guess values.

Code: Select all

garch(p=1,q=1,regressors) / stk
compute beta0=%beta,xx0=%xx
*
do gend=width,180
   garch(p=1,q=1,regressors,initial=beta0,hessian=xx0) gend-width+1 gend stk
   # constant %garchv
   compute %pt(coeffs,gend,%beta)
end do gend
There's no guarantee that that will work, but at least you won't be feeding forward unconverged estimates.
Post Reply