Hi Aurelio,
this was indeed a bug in the previous version of [log in to unmask]

This has been fixed in the latest version (see below).

Bug fixed (thanks to Charles Bos). Several functions of the MGarch class had not been included in the oxo file, e.g. GetVarf_vec, Append_in, Append_out, etc.
 
Sébastien


Le Oct 21, 2009 à 2:32 PM, Aurelio Rodrigues a écrit :

Hello,
I tried to use the command Ox Batch Code for G@RCH, but appeared the following message:
Runtime error: 'Append_in' undefined member function
Runtime error occurred in main(36), call trace: 
C:\ooo.ox (36): main
how do I fix this problem?
Thanks

Aurelio Rodrigues


#include <oxstd.h>
#include <oxdraw.h>
#import <packages/MGarch1/mgarch>

main()
{

//--- Ox code for MG@RCH( 2)
decl model = new MGarch();

model.Load("C:\\data.xls");
model.Deterministic(-1);

model.Select(Y_VAR, {"DLP", 0, 0});
model.Select(Y_VAR, {"DLV", 0, 0});

model.CSTS(1,1);
model.DISTRI(NORMAL);
model.ARMA_ORDERS(1,1);
model.GARCH_ORDERS(1,1);
model.VARIANCE_TARGETING(0);
model.MODEL(DCC);
model.MLE(QMLE);
model.UGARCH_MODELS(GARCH);
model.UGARCH_TRUNC(1000);
model.UGARCH_PrintOutput(1);
model.UGARCH_ARFIMA(0);
model.ONE_STEP(0);
model.TSE_LAGS(0);
model.SetSelSampleByDates(dayofcalendar(2004, 1, 4), dayofcalendar(2008, 8, 7));
model.Initialization(<>);
model.PrintOutput(1);
model.DoEstimation();
for (decl i=0;i<model.m_cN;++i)
{
model.Append_in(model.m_dH[][i],sprint("CondVar_",model.a_namesY[i]));
}
decl cov_vec;
cov_vec=model.GetCov_vec();
for (decl i=0;i<columns(cov_vec);++i)
model.Append_in(cov_vec[][i],model.GetCovNames()[i]);
decl Varf;
Varf=model.GetVarf_vec();
for (decl i=0;i<model.m_cN;++i)
model.Append_out(Varf[][i],sprint("Var_f",model.a_namesY[i]));
decl covf_vec;
covf_vec=model.GetCovf_vec();
for (decl i=0;i<columns(covf_vec);++i)
model.Append_out(covf_vec[][i],model.GetCovfNames()[i]);
model.Save("C:\\data.xls");

delete model;
}

Sébastien Laurent 
Associate Professor in Econometrics 
Department of Quantitative Economics 
Maastricht University, School of Business and Economics   
P.O. Box 616, 6200 MD Maastricht, The Netherlands

Tel:  + 31 43 388 38 43   
Fax:  + 31 43 388 48 74