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

1 view (last 30 days)
Mads on 15 Mar 2021
Edited: Mads on 15 Mar 2021
%% Forecast E-GARCH
eModel = egarch(1,1); % Create a garch (1,2) model (proposed by BIC)
j=500; % Number of observations within each window
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;
% Forecasting the variance for each horizon
temp=forecast(eEstModel,1, yield_monthly_05(g-h:g)');
VolForecast(g+1) = temp(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)

Community Treasure Hunt

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

Start Hunting!