Page 1 of 1

problem with egarch 22 agian

Posted: Sun Aug 30, 2009 5:19 pm
by karl5914
hi, the same set of code i had before,

******************two equations*****************
LOG Hi / LH
LOG Lo /LL
SET Range = log(LH / LL)
SET R = LOG(Cl/Cl{1})
linreg(NOPRINT) R / E
#constant
declare series u
declare series h
declare series q
nonlin A11 A22 A33 A44 A2 A3 A4

SET Q / = %seesq**0.5
SET H / = EXP(RANGE - 0.43)
SET U / = 0.0
compute A11=1, A22=0.87,A33=0.05,A44=-0.1, A2=0.12,A3=0.01,A4=-0.1
frml res = (RANGE - 0.43 - LOG(h))/0.29
frml qf = exp(A11+A22*log(q{1}) + A33*u{1} + A44*E{1}/q{1})
frml HF = exp(qf{1}+A2*log(h{1})+A3*u{1} + A4*E{1}/h{1})
frml logl = h(t)=hf(t),(Q(t)=QF(t)),(u(t)=res(t)),-0.5*(log(0.29**2) + u(t)**2/.29**2)
maximize(method=GENETIC,iters=100) LOGL 10 500
maximize(method=bfgs, iters=100) LOGL 10 500

Display '_________________________________________________'
Display '_________________________________________________'
display 'OUT OF SAMPLE 1 STEP FORECASTS:'

DO J = 1, 1001
declare series u
declare series h
nonlin A11 A22 A33 A44 A2 A3 A4

SET Q / = sqrt(%seesq)
SET H / = EXP(RANGE - 0.43)
SET U / = 0.0
compute A11=1, A22=0.87,A33=0.05,A44=-0.1, A2=0.12,A3=0.01,A4=-0.1
frml res = (RANGE - 0.43 - LOG(h))/0.29
frml qf = exp(A11+A22*log(q{1}) + A33*u{1} + A44*E{1}/h{1})
frml HF = exp(qf{1}+A2*log(h{1})+A3*u{1} + A4*E{1}/h{1})
frml logl = h(t)=hf(t),(Q(t)=QF(t)),(u(t)=res(t)),-0.5*(log(0.29**2) + u(t)**2/.29**2)
maximize(method=GENETIC,iters=100,noprint) LOGL 10+J 1000+J
maximize(method=BFGS, iters=100,noprint) LOGL 10+J 1000+J

COMP H(500+J) = exp(%BETA(1)+%BETA(2)*log(q(998+J))+%BETA(3)*u(998+J) +%BETA(4)*E(998+J)/h(998+J)+%BETA(5)*log(h(999+J))+%BETA(6)*u(999+J) +%BETA(7)*E(999+J)/h(499+J))
DISP H(500+J)
END DO J



when i do the 1 step ahead forecast, i always get very extreme results, it is extremely sensitive to the intial value setting, what i can do to improve it?

Re: problem with egarch 22 agian

Posted: Sun Aug 30, 2009 8:29 pm
by TomDoan
karl5914 wrote:hi, the same set of code i had before,

Code: Select all

frml qf = exp(A11+A22*log(q{1}) + A33*u{1} + A44*E{1}/q{1})
frml HF = exp(qf{1}+A2*log(h{1})+A3*u{1} + A4*E{1}/h{1})

COMP H(500+J) = exp(%BETA(1)+%BETA(2)*log(q(998+J))+%BETA(3)*u(998+J) +%BETA(4)*E(998+J)/h(998+J)+%BETA(5)*log(h(999+J))+%BETA(6)*u(999+J) +%BETA(7)*E(999+J)/h(499+J))
when i do the 1 step ahead forecast, i always get very extreme results, it is extremely sensitive to the intial value setting, what i can do to improve it?
Your forecast calculation doesn't match the formulas you're using for estimation - the q function comes into the h function in exp form, and that's not reflected in your forecast. You might want to look at your formulas a bit more carefully.