Error using garch/validateModel; Non-zero degree P requires a non-zero degree Q.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Greetings all, I'm receiving this error when attempting to run a GARCH(1,1) on a student-t distribution with varying degrees of freedom (either 4 or 5). The vector is asset returns of about 250 rows. The function wrapper is below (just to show how I set up the model) and the specific error is also below. I am new to GARCH forecasting and am hoping for some help, thanks.
function Vf = VolatilityForecast(returns,numPeriods,dof)
% VOLATILITYFORECAST Returns volatility forecast of return series
% Given a TxNUMASSETS matrix RETURNS, VOLATILITYFORECAST returns
% NUMPERIODS volatility forecasts. Pass DOF to assume a t-distribution
% with DOF degrees of freedom. Pass an empty matrix [] for a standard
% normal
% http://www.mathworks.com/help/econ/garch.forecast.html
% fit a GARCH(1,1) model to the data
model = garch(1,1);
if ~isempty(dof)
model.Distribution = struct('Name','t','DoF',dof);
end
N = size(returns,2);
if N>1
Vf=zeros(numPeriods,N);
for i=1:N
try
fit = estimate(model,returns(:,i));
Vf(:,i) = sqrt(forecast(fit,numPeriods,'Y0',returns(:,1)));
catch
e = MException('VolatilityForecast:ModelFitFailure', ...
sprintf('Model fit failed at asset %i',i));
warning('Model fit failed at asset %i, printing data then throwing error',i);
returns(:,i)
throw(e);
end
end
else
fit = estimate(model,returns);
% forecast the conditional variance for numPeriods using the fitted
% model; use the observed returns as presample innovations for the
% forecast
Vf = sqrt(forecast(fit,numPeriods,'Y0',returns));
end
end
And the error:
Error using VolatilityForecast (line 24)
Estimated GARCH model is invalid.
Caused by:
Error using garch/validateModel (line 767)
Non-zero degree P requires a non-zero degree Q.
0 commentaires
Réponses (3)
Karl-Martin
le 16 Mar 2015
Hi Jason,
I got this error in my modelling too and I suppose it happens to occur as follows:
In the 'garch.m' function of the Econometrics toolbox it is stated:
% o The coefficients GARCH and ARCH are each associated with an
% underlying lag operator polynomial and subject to a near-zero
% tolerance exclusion test. That is, each coefficient is compared to
% the default zero tolerance 1e-12, and is included in the model only
% if the magnitude is greater than 1e-12; if the coefficient magnitude
% is less than or equal to 1e-12, then it is sufficiently close to zero
% and excluded from the model. See LagOp for additional details.
So if is a parameters is too close to zero it is excluded from the model...
This can turn a GARCH(1,1) model into a GARCH(1,0) model which is invalid.
My advice is to choose a larger fit-period for the model estimation.
0 commentaires
roblocks
le 13 Jan 2016
hey Jason, for me the error occurred for time series which actually didn't feature any conditional heteroscedasticity. So testing for it in advance (archtest(x)) solved my problem!
Best!
0 commentaires
Hang Qian
le 15 Déc 2017
There is a work-around: set the optimization algorithm as interior-point so that Q will not be exactly zero.
options = optimoptions(@fmincon,'Algorithm','interior-point');
Mdl = garch(1,1);
estimate(Mdl,y,'options',options);
In that case, Q can be extremely small if there is no volatility clustering found in the data, but the error message will not pop up. The trick can be useful if we want to estimate many garch(1,1) models in a FOR loop.
Hope that helps,
Hang Qian
1 commentaire
Bianca Krämer
le 14 Août 2018
Hi, if I apply your work-around the algorithm somehow restricts my ML estimation. I have 490 time series which I want to test for the optimal model fit. Under the old garchset and garchfit I got something along the line like 30% GARCH(1,1) 30% ARCH(1) and some GARCH(2,1) etc. as best fitted models.
However, by applying the "interior-point" algorithm I only get ARCH(1) models as the best model using the AIC_BIC Criterion.
Any Idea what might be going on? Also If i look at the P and Q Parameters they are actually not that small for the time Series where i get the
Caused by: Error using garch/validateModel (line 791) Non-zero degree P requires a non-zero degree Q.
error. I think it might be more of non existing conditional heteroscedasticity.....
Thank you for your help. Michael
Voir également
Catégories
En savoir plus sur Conditional Variance Models dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!