Effacer les filtres
Effacer les filtres

garchfit vs estimate inconsistent results and speed

3 vues (au cours des 30 derniers jours)
Giovambattista Perciaccante
Giovambattista Perciaccante le 17 Déc 2017
Commenté : Michael Duerk le 8 Fév 2019
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 commentaire
Michael Duerk
Michael Duerk le 8 Fév 2019
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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Conditional Mean Models dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by