Garch forecasting

Hi, am currently trying to use the garchpred function to produce a forecast with two explanatory variables. However, whenever running the code I get an error message and I could not figure out. Hence, I would really appreciate your help. Attached is the code that I am trying to run, which I extracted from the overall code, and the specifications of the parameters.
clear cd C:\Users\Joerg\University\TermPaper [num,txt,raw]=xlsread('Testing.xls'); Series=num(:,1); X=num(:,2:3); XF=num(1:5,4:5); Periods=5; Spec = garchset('P', 1, 'Q', 1); % fitting a GARCH(1,1) [sigmaForecast,meanForecast,sigmaTotal,meanRMSE] = garchpred(Spec,Series,Periods,X,XF)
Series: 1605x1 double X: 1605x2 double XF: 5x2 double
I always get the following error message which I do not understand given the current data since I believe this matches. What could be wrong? ??? Error using ==> garchpred at 272 Number of specified regression coefficients must equal number of columns in regression matrix.
Thank you for your help! Joerg

1 Comment

Oleg Komarov
Oleg Komarov on 31 May 2011
Please format the code and the error message: http://www.mathworks.com/matlabcentral/answers/7885-tutorial-how-to-format-your-question

Sign in to comment.

Answers (1)

Oleg Komarov
Oleg Komarov on 31 May 2011
You have to fit (garchfit?) the past history (X) to retrieve the coefficients and supply them to:
Spec = garchset(...,'Regress',coeff)

Categories

Asked:

on 31 May 2011

Community Treasure Hunt

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

Start Hunting!