function [forecast, truev, bench_mean, MSFE, MSFE_bench, MSFE_ratio] = var_est_s(X, h) for i=100:192-h [B_ols T_stat Fore] = var_est_f(X(1:i,:), 2, 1, h); forecast(i+h,:) = Fore; truev(i+h,:) = X(i+h,:); bench_mean(i+h,:) = mean(X(1:i,:)); end MSFE = mean((truev(100+h:end,:)-forecast(100+h:end,:)).^2); MSFE_bench = mean((truev(100+h:end,:)-bench_mean(100+h:end,:)).^2); MSFE_ratio = MSFE./MSFE_bench;