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

조회 수: 4 (최근 30일)
Mads
Mads 2021년 3월 15일
편집: Mads 2021년 3월 15일
%% 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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Conditional Variance Models에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by