Hi all,
I was doing a loop of arfima models, using ARFIMA1.04. But after about 180
loops ox stops and report a error:
''Runtime error: out of memory
Runtime error occurred in Grow(389), call trace:
D:\OxMetrics5\Ox\src\database.ox (389): Grow
D:\OxMetrics5\Ox\src\modelbase.ox (82): Grow
D:\OxMetrics4\Ox\packages\arfima\arfima.ox (1024): Forecast
D:\Program Files\OxMetrics5\Ox\VaR codes\IN_SAMPLE\RV\ARFIMAX1.ox
(38): main
Ox reports errors: exit code= 2!!''
Can anyone help me with this issue? Thanks very much. My PC has 3g memory
and OS is Windows XP sp2. Below is my arfima codes:
#include <oxstd.h>
#include <oxfloat.h>
#import <packages/arfima/arfima>
#include <oxdraw.h>
main()
{
decl n=1195;
decl arfima,i,RV=new matrix[n][1];
arfima = new Arfima();
arfima.Load("/data/100times return RV.csv");
arfima.Deterministic(FALSE);// create Constant,Trend,Seasonals
arfima.Select(Y_VAR, { "LRV_future", 0, 0 } );
arfima.Select(X_VAR, { "Constant", 0, 0 } );
arfima.Select(X_VAR, { "daily_future", 0, 0 } );
arfima.Select(X_VAR, { "dummy_future", 0, 0 } ); //data
already laged
arfima.ARMA(0,1); // ARFIMA(0,d,1)
arfima.SetMethod(M_MAXLIK);
arfima.UseSampleMean();
for (i=1; i<1196;++i)
{
arfima.SetSelSample(1+i, 1, 1005+i, 1);
MaxControl(-1,0,1);
arfima.Estimate();
RV[i-1][0]=exp(arfima.Forecast(1)[0][0]+0.5*(arfima.Forecast(1)[0]
[1])^2); //conditional RV
arfima.SetPrint(TRUE);///
print("There are ",1195-i,"loops left...");
arfima.SetPrint(FALSE);///
}
print(RV);
delete arfima;
}
Best regards,
Shuai
|