Error "Number of rows in presample array 'Z0' must be at least 1."

3 views (last 30 days)
%% Forecast E-GARCH
eModel = egarch(1,1); % Create a garch (1,2) model (proposed by BIC)
j=500; % Number of observations within each window
h=276;
T = length(yield_monthly_05');
VolForecast = zeros(693,1);
%rolling window moves along one each time
for g=h+1:T
% Estimating a model with 30 observations each (g-k)
eEstModel = estimate(eModel, yield_monthly_05(g-h:g)','Display', 'off');
% Simulating 10000 paths to get the innovations
rng default;
[v,z]=simulate(eEstModel,10000);
% Forecasting the variance for each horizon
temp=forecast(eEstModel,1, yield_monthly_05(g-h:g)');
VolForecast(g+1) = temp(end);
end
Hello. I am trying to forecast an egarch model. This loop works perfectly fine when forecasting a standard garch model.
In what seems to be the line "[v,z]=simulate(eEstModel,10000);", I get the error: "Number of rows in presample array 'Z0' must be at least 1." Can anyone help me out? Thank you so much

Answers (0)

Categories

Find more on Conditional Variance Models in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!