GARCH: RATS 7.3 and 8.0 giving different results?
Posted: Thu Jun 02, 2011 11:24 am
UPDATE 06/05/2011: I have removed the data file as it contains proprietary data.
Hi Tom,
This is a follow-up on our conversation from this morning. I am attaching a RATS code that is giving me different results in RATS 7.3 and RATS 8.0.
In 7.3, my results with MAXIMIZE are essentially the same as with GARCH command. In 8.0, I get pretty much the same results with MAXIMIZE as I did in 7.3, but GARCH command is giving me results that are sufficiently different to cause some worry.
The code is below, and code, output and scanned output from 7.3 (I cannot re-run it, as I was running my code on a computer that was not mine).
Can you please test if you are also getting different results depending on the version? If yes, what is the cause for these discrepancies, and how can I eliminate them?
Thanks,
Marin
Hi Tom,
This is a follow-up on our conversation from this morning. I am attaching a RATS code that is giving me different results in RATS 7.3 and RATS 8.0.
In 7.3, my results with MAXIMIZE are essentially the same as with GARCH command. In 8.0, I get pretty much the same results with MAXIMIZE as I did in 7.3, but GARCH command is giving me results that are sufficiently different to cause some worry.
The code is below, and code, output and scanned output from 7.3 (I cannot re-run it, as I was running my code on a computer that was not mine).
Can you please test if you are also getting different results depending on the version? If yes, what is the cause for these discrepancies, and how can I eliminate them?
Thanks,
Marin
Code: Select all
*** DATA MANAGEMENT ***
OPEN DATA "D:\Marin\cheesedata.xlsx"
DATA(FORMAT=XLSX,ORG=COLUMNS) 1 1475 CASH ICF2N ICF2N_L1 ICF2N_DL0 ICF2N_DL1 ICF2N_DL2 ICF2N_DL3 ICF2N_DL4
set basis2nl1 = cash{1} - icf2n_l1
set cashdl0 = cash - cash{1}
*** PARAMETERS SETUP ***
compute gstart = 10
compute gend = 1470
compute n = 2
*** REPLICATING MVGARCH-BEKK - WITHOUT XREGRESSORS ***
*** MVGARCH-BEKK using GARCH command ***
equation casheq cashdl0
#cashdl0{1 to 7} icf2n_dl1 icf2n_dl2 icf2n_dl3 icf2n_dl4 basis2nl1
equation icf2neq icf2n_dl0
#cashdl0{1 to 7} icf2n_dl1 icf2n_dl2 icf2n_dl3 icf2n_dl4 basis2nl1
group meanmodel casheq icf2neq
GARCH(P=1,Q=1, mv=bekk, model=meanmodel) gstart gend CASHDL0 ICF2N_DL0
*** MVGARCH-BEKK using MAXIMIZE command***
NONLIN(PARMSET=MEANPARMS) BC_CASHDL0_L1 BC_CASHDL0_L2 BC_CASHDL0_L3 BC_CASHDL0_L4 BC_CASHDL0_L5 BC_CASHDL0_L6 $
BC_CASHDL0_L7 BF_CASHDL0_L1 BF_CASHDL0_L2 BF_CASHDL0_L3 BF_CASHDL0_L4 BF_CASHDL0_L5 BF_CASHDL0_L6 BF_CASHDL0_L7 $
BC_ICF_DL1 BC_ICF_DL2 BC_ICF_DL3 BC_ICF_DL4 BF_ICF_DL1 BF_ICF_DL2 BF_ICF_DL3 BF_ICF_DL4 $
BC_BASISL1 BF_BASISL1
declare series[vect] yv
gset yv = ||cashdl0, icf2n_dl0||
declare frml[vect] residv
FRML mu_cash = BC_CASHDL0_L1 * CASHDL0{1} + BC_CASHDL0_L2 * CASHDL0{2} + BC_CASHDL0_L3 * CASHDL0{3} + $
BC_CASHDL0_L4 * CASHDL0{4} + BC_CASHDL0_L5 * CASHDL0{5} + BC_CASHDL0_L6*CASHDL0{6} + BC_CASHDL0_L7 * CASHDL0{7} + $
BC_ICF_DL1 * ICF2N_DL1 + BC_ICF_DL2 * ICF2N_DL2 + BC_ICF_DL3 * ICF2N_DL3 + BC_ICF_DL4 * ICF2N_DL4 + $
BC_BASISL1 * BASIS2NL1
FRML mu_FUT = BF_CASHDL0_L1 * CASHDL0{1} + BF_CASHDL0_L2 * CASHDL0{2} + BF_CASHDL0_L3 * CASHDL0{3} + $
BF_CASHDL0_L4 * CASHDL0{4} + BF_CASHDL0_L5 * CASHDL0{5} + BF_CASHDL0_L6*CASHDL0{6} + BF_CASHDL0_L7 * CASHDL0{7} + $
BF_ICF_DL1 * ICF2N_DL1 + BF_ICF_DL2 * ICF2N_DL2 + BF_ICF_DL3 * ICF2N_DL3 + BF_ICF_DL4 * ICF2N_DL4 + $
BF_BASISL1 * BASIS2NL1
FRML RES_CASH = CASHDL0 - MU_CASH
FRML RES_FUT = ICF2N_DL0 - MU_FUT
FRML RESIDV = ||RES_CASH,RES_FUT||
nlsystem(frmlvector=residv,parmset=meanparms,noprint,resids=u) gstart gend
compute rr=%sigma
declare series[symm] h uu
gset h * gend = rr
gset uu * gend = rr
declare symm hx(n,n)
declare vect ux(n)
declare frml[symm] hf
frml logl = $
hx = h(t) = hf(t) , $
ux = residv , $
uu(t) = %outerxx(ux) , $
%pt(u,t,ux) , $
%logdensity(hx,ux)
declare rect varinit(n,n) vbrinit(n,n) var(n,n) vbr(n,n)
declare packed vct(n,n)
declare symm vcs
compute varinit=sqrt(.05)*%identity(n), vbrinit=sqrt(.45)*%identity(n)
compute vct=%decomp(rr)
declare real vbr11 vbr12 vbr21 vbr22
compute vbr11 = vbrinit(1,1)
compute vbr12 = vbrinit(1,2)
compute vbr21 = vbrinit(2,1)
compute vbr22 = vbrinit(2,2)
declare real var11 var12 var21 var22
compute var11 = varinit(1,1)
compute var12 = varinit(1,2)
compute var21 = varinit(2,1)
compute var22 = varinit(2,2)
nonlin(parmset=bekkparms) vct var11 var12 var21 var22 vbr11 vbr12 vbr21 vbr22
FUNCTION %%BEKKInit
compute vcs=%ltouterxx(vct)
compute vbr = || vbr11, vbr12| vbr21, vbr22||
compute var = || var11, var12| var21, var22||
END
frml hf = vcs + %mqform(h{1},vbr) + %mqform(uu{1},var)
maximize(title="Standard BEKK Model",start=%%BEKKInit(),parmset=meanparms+bekkparms, $
method=bfgs,iters=400,pmethod=simplex,piters=5) logl gstart gend