New vs Old Econometrics Toolbox: garchset/garchfit vs gatch/estimate/infer for getting conditional standard deviations

5 visualizaciones (últimos 30 días)
Using Econometrics Toolbox in Matlab R2012b, we had code doing the following, in which we are specifically interested in obtaining xvol = conditional standard deviations from a GARCH(1,1) model (using T-distribution) fitted to a timeseries = xdata, for xdata.
>> spec = garchset('Distribution','T','VarianceModel','GARCH','P',1,'Q',1);
>> [spec, errors, LLF, res, xvol] = garchfit(spec, xdata);
%where xdata is an n x 1 array containing a time series
%and desired output is in xvol = conditional standard deviations, also n x 1.
In Matlab R2014b (to which we have just upgraded), the garch* family of functions have been removed from the Econometrics Toolbox. We've reviewed docs of new functions/objects that replaced them and tried to perform the same task as above with the following:
>>model = garch(1,1);
>>model.Distribution = 't';
>>EstMdl = estimate(model, xdata);
>>V = infer(EstMdl,xdata); %V = conditional variances, also n x 1
>>xvol = sqrt(V); %(conditional standard deviations = squareroot of conditional variances)
but the results are not lining up with what we saw before (and in some cases only produce NaNs.)
We assume we have not correctly reinterpreted our calculation using the new garch objects/functions. Could someone please provide insight on how to handle this?
Thanks in advance

Respuestas (1)

Hang Qian
Hang Qian el 14 de Abr. de 2015
I think there are two main causes of the result discrepancy.
First, the GARCHFIT estimates an offset term (the intercept term in the mean equation) by default, while GARCH.ESTIMATE assumes the offset term is zero by default. The reason is that new GARCH is sometimes used as the error variance model of an ARIMA model. Therefore, GARCH itself does not include an offset term any more. So the translation from GARCHSET to GARCH is the following:
spec = garchset('VarianceModel','GARCH','P',1,'Q',1);
model = garch('ARCHLags',1,'GARCHLags',1,'Offset',NaN);
Then garchfit(spec, y) usually gives the same results as estimate(model,y).
Second, the Econometrics Toolbox relies on the Optimization Toolbox to maximize likelihood function of a time series model. However, the solvers in Optimization Toolbox have been improving over the years and may give better results (in term of higher likelihood values). In addition, the best-performed algorithm is chosen as the default solver. It is possible to have occasional discrepancy in the estimated coefficients, especially when the sample size is small and/or the data poorly fit the model. If we really want to replicate the old results, I think at least we may want to control the optimization option. For example, the default setting in GARCHSET looks like
Optimization = optimset(Optimization,'Algorithm','active-set');
While currently the default setting in GARCH.ESTIMATE looks like
options = optimoptions(options, 'Algorithm', 'sqp', 'TolCon' , 1e-7, ... 'Display' , 'off', 'Diagnostics', 'off');
Our apology for the inconvenience during the transition from the old GARCH to the new GARCH. I think the new GARCH suite is better than the old GARCH tools, so the old was retired in 2014.
Hang Qian

Categorías

Más información sobre Conditional Variance Models en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by