Error "Number of rows in presample array 'Z0' must be at least 1."
5 次查看(过去 30 天)
显示 更早的评论
%% 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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Conditional Variance Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!