garchfit vs estimate inconsistent results and speed

3 次查看(过去 30 天)
Hello I always used garchset and garchfit for work pourpose and since I switched to 2016a I can't use those functions anymore so I am stuck with 2013a. The new functions that substitute garchset and garchfit are ARIMA and estimate. I will provide the code I use to switch between old and new functions but the problem is that the new functions are way slower.
OLD ONE: garchset + garchfit
% set the model ARMA(1,1) + GARCH(1,1) with errors distributed like a t-student with 6 DoF
mdl = garchset('Distribution' , 'T' ,'DoF', 6,'P',1, 'Q', 1, 'R', 1, 'M', 1, 'VarianceModel', 'GARCH');
% estimation of coefficients
tic
garchfit(mdl, r1)
toc
this took 0.2 second
NEW METHOD: ARIMA + estimate
% specify the model for the conditional variance as GARCH(1,1) with errors distributed like a t-student with 6 DoF
varmdl = garch('GARCHLags', 1, 'ARCHLags', 1, 'Distribution',struct('Name','t','DoF',6))
% specify the model for the mean as ARMA(1,1) with errors distributed like a t-student with 6 DoF
mdl = arima('ARLags',1, 'MALags',1,'Distribution',struct('Name','t','DoF',6),'Variance', varmdl)
% setting the same option for the fmincon function that were used by garchfit
opt=optimoptions(@fmincon,'PhaseOneTotalScaling','off', ...
'NoStopIfFlatInfeas','off','Algorithm','active-set', 'UseParallel','never')
% estimation of coefficients
tic
es = estimate(mdl, r1, 'Options', opt)%, 'Display', 'off');
toc
this took about 3 seconds and despite I used the same dataset and the same options for fmincon the results were slightly different. So what's happening? It seems to me like the new functions are worse. I don't care much about the difference in estimated coefficients but the speed is more that 10 times SLOWER. I use this to get real time signals for trading but with large number of stocks in my portfolio it is unusable anymore. And I don't want to be stuck wit 2013a either. Could someone please help me understand what's happening here?
thank you
  1 个评论
Michael Duerk
Michael Duerk 2019-2-8
Hello,
unfortunately I am not able to provide a solution for you. We did ecounter the same problem tho. I tried different algorithms, however no luck there as well. It seems the ML-Estimator is more thorrow and complex which results in longer compilation time....!
Do you have any new thoughts or ideas concerning the problem?
% Converting old GARCH functions to new Model Objects
% This example does not show how to reproduce equivalent results between the models,
% because, in general, the estimates between the two functionalities might differ.
% Set the optimization algorithm as interior-point so that Q will not
% be exactly zero
options = optimoptions('fmincon','Algorithm','interior-point');
% Specify the model shell
model1 = garch('Offset',NaN,'GARCHLags', 1, 'ARCHLags', 1,...
'Distribution','t');
%Estimate the model surpress the Output
[Coeff,Errors,logL,info] = estimate(model1,Renditen,'Display','off','options',options);
Thank you!
Greetings

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Conditional Mean Models 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by