Code Problems

Discussions of ARCH, GARCH, and related models
sulong
Posts: 13
Joined: Sun Mar 20, 2011 1:59 am

Code Problems

Unread post by sulong »

Hi All,

I am trying to model the following process (Bohl & Brzeszczynki, 2006, Int. Fin. Markets, Inst. and Money 16 (2006) 370–383 )
Bohl.jpg
Bohl.jpg (50.04 KiB) Viewed 5371 times
I have written the following code, but it doesnt seem to work. Would be grateful for any help.


set h =0.0
set temp =0.0
set u = 0.0
set R = sreturn

nonlin a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 d1 d2 d3 e1 f1 g0 g1 g2 g3
frml e = R - a1*Mon - a2*Tue - a3*Wed - a4*Thur - a5*Fri $
- b1*Dt*Mon - b2*Dt*Tue - b3*Dt*Wed - b4*Dt*Thur - b5*Dt*Fri $
- c1*R{1} - c2*Dt*R{1} - d1*((%GARCHV)^0.5)*R{1} - d2*Dt*((%GARCHV)^0.5)*R{1} - d3*Rf{1}

com a1=1, a2=0, a3=0, a4=0, a5=0, b1=0.11, b2=0, b3=0, b4=0, b5=0, $
c1=0.01, c2=0.0, d1=0.01, d2=0, d3=0.01,e1=0.1, f1=0.01, $
g0=0.11, g1=0.1,g2 =0.1, g3=2, h1=0.11, i1=0.11

frml var = (1+(f1*Dt))*(g0 + g1*temp{1}^0.5 + g2*e{1}^2 + %if(e{1}<0,g3*e{1}^2,0.0))
frml L = (temp=var),%logdensity(var,e)
max L 20 *

sulong
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Code Problems

Unread post by TomDoan »

%GARCHV is only defined by the GARCH instruction. Where you have %GARCHV, you want (as you've written this) TEMP instead, though most people would use H where you use TEMP throughout the specification.
sulong
Posts: 13
Joined: Sun Mar 20, 2011 1:59 am

Re: Code Problems

Unread post by sulong »

Thanks, I will try to fix that.
Post Reply