Error using garch/validateModel; Non-zero degree P requires a non-zero degree Q.

18 views (last 30 days)
Jason on 23 Jan 2014
Commented: Bianca Krämer on 14 Aug 2018
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
% NUMPERIODS volatility forecasts. Pass DOF to assume a t-distribution
% with DOF degrees of freedom. Pass an empty matrix [] for a standard
% normal
% fit a GARCH(1,1) model to the data
model = garch(1,1);
if ~isempty(dof)
model.Distribution = struct('Name','t','DoF',dof);
N = size(returns,2);
if N>1
for i=1:N
fit = estimate(model,returns(:,i));
Vf(:,i) = sqrt(forecast(fit,numPeriods,'Y0',returns(:,1)));
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);
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));
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.

Answers (3)

Karl-Martin on 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.

roblocks on 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!

Hang Qian
Hang Qian on 15 Dec 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);
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 Comment
Bianca Krämer
Bianca Krämer on 14 Aug 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

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!