From 7b7339cad4ca187254ab6ee81bef8b7444ee7f41 Mon Sep 17 00:00:00 2001 From: adjemian <adjemian@ac1d8469-bf42-47a9-8791-bf33cf982152> Date: Fri, 21 Sep 2007 16:50:36 +0000 Subject: [PATCH] Other cosmetic changes... git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1392 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/bvar_forecast.m | 4 ++-- matlab/bvar_toolbox.m | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/matlab/bvar_forecast.m b/matlab/bvar_forecast.m index e0f8c6ef7f..24f34673f6 100644 --- a/matlab/bvar_forecast.m +++ b/matlab/bvar_forecast.m @@ -48,7 +48,7 @@ function bvar_forecast(nlags) lags_data = forecast_data.initval; for t = 1:options_.forecast X = [ reshape(flipdim(lags_data, 1)', 1, ny*nlags) forecast_data.xdata(t, :) ]; - y = X(:,1:k) * Phi; + y = X * Phi; lags_data = [ lags_data(2:end, :); y ]; sims_no_shock(t, :, d) = y; end @@ -58,7 +58,7 @@ function bvar_forecast(nlags) for t = 1:options_.forecast X = [ reshape(flipdim(lags_data, 1)', 1, ny*nlags) forecast_data.xdata(t, :) ]; shock = (Sigma_lower_chol * randn(ny, 1))'; - y = X(:,1:k) * Phi + shock; + y = X * Phi + shock; lags_data = [ lags_data(2:end, :); y ]; sims_with_shocks(t, :, d) = y; end diff --git a/matlab/bvar_toolbox.m b/matlab/bvar_toolbox.m index 12522f4d76..41bca2e619 100644 --- a/matlab/bvar_toolbox.m +++ b/matlab/bvar_toolbox.m @@ -94,11 +94,7 @@ function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags) ydata = dataset(idx, :); T = size(ydata, 1); - if nx - xdata = ones(T,1); - else - xdata = []; - end + xdata = ones(T,nx); % Posterior density var = rfvar3([ydata; ydum], nlags, [xdata; xdum], [T; T+pbreaks], lambda, mu); @@ -131,8 +127,6 @@ function [ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags) % Add forecast informations if nargout >= 5 forecast_data.xdata = ones(options_.forecast, nx); - % Useless if nx=0, but with the declaration of an empty matrix here we would have to add an if statement - % inside a loop (see bvar_forecast.m). forecast_data.initval = ydata(end-nlags+1:end, :); if options_.first_obs + options_.nobs <= size(dataset, 1) forecast_data.realized_val = dataset(options_.first_obs+options_.nobs:end, :); -- GitLab