The logical index at position 1 contains a true value outside the array boundary
位置 1 处的逻辑索引包含一个在数组边界之外的 true 值。
Error tsVAR/estimate (line 826)
出错 tsVAR/estimate (第 826 行)
Ei = E(s == iii,:);
出错 TVAR_v1 (第 92 行)
EstMdl = estimate(tMdl,tt,Ye(:,1:6), Y0 = Y00(:,1:6),...
data = readtable(file_var);
year_quarter = data{:,1};
year = floor(year_quarter);
quarter = round((year_quarter - year) * 4 + 1);
month = (quarter - 1) * 3 + 1;
dt = datetime(year, month, 1);
data = table2timetable(data);
[Yt,Yc] = hpfilter(raw_data,lambda,FilterType="one-sided");
Yd{:,"state"} = [NaN; Yc{1:end-1,"lrgdp"}];
title(pic.Properties.VariableNames(j))
[h, pValue] = adftest(Ye);
Mdls = varm(Constant=NaN(numseries,1),Lags=[1 2 3 4], ...
tt = threshold(0,Type = "discrete");
tt.StateNames = ["Recession" "Expansion"];
EstMdl = estimate(tMdl,tt,Ye(:,1:6), Y0 = Y00(:,1:6),...
Z=Ye(:,1),Type="exogenous",IterationPlot=false);