From 80086ff4ab94586928363dfea97f3419128e8de5 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Sun, 10 Apr 2016 18:12:15 +0200 Subject: [PATCH] Clarify naming of var_obs_index to indicate it refers to decision rule order --- matlab/dynare_estimation_init.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index 8e4546de5..b041627a0 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -395,24 +395,24 @@ npred = M_.nspred; % Number of predetermined variables. nspred = M_.nspred; % Number of predetermined variables in the state equation. % Setting resticted state space (observed + predetermined variables) -var_obs_index = []; +var_obs_index_dr = []; k1 = []; for i=1:options_.number_of_observed_variables - var_obs_index = [var_obs_index; strmatch(options_.varobs{i},M_.endo_names(dr.order_var,:),'exact')]; + var_obs_index_dr = [var_obs_index_dr; strmatch(options_.varobs{i},M_.endo_names(dr.order_var,:),'exact')]; k1 = [k1; strmatch(options_.varobs{i},M_.endo_names, 'exact')]; end % Define union of observed and state variables -k2 = union(var_obs_index,[M_.nstatic+1:M_.nstatic+M_.nspred]', 'rows'); +k2 = union(var_obs_index_dr,[M_.nstatic+1:M_.nstatic+M_.nspred]', 'rows'); % Set restrict_state to postion of observed + state variables in expanded state vector. oo_.dr.restrict_var_list = k2; bayestopt_.restrict_var_list = k2; % set mf0 to positions of state variables in restricted state vector for likelihood computation. [junk,bayestopt_.mf0] = ismember([M_.nstatic+1:M_.nstatic+M_.nspred]',k2); % Set mf1 to positions of observed variables in restricted state vector for likelihood computation. -[junk,bayestopt_.mf1] = ismember(var_obs_index,k2); +[junk,bayestopt_.mf1] = ismember(var_obs_index_dr,k2); % Set mf2 to positions of observed variables in expanded state vector for filtering and smoothing. -bayestopt_.mf2 = var_obs_index; +bayestopt_.mf2 = var_obs_index_dr; bayestopt_.mfys = k1; [junk,ic] = intersect(k2,nstatic+(1:npred)'); @@ -447,7 +447,7 @@ if options_.block == 1 % Set mf1 to positions of observed variables in restricted state vector for likelihood computation. [junk,bayestopt_.mf1] = ismember(k1,oo_.dr.restrict_var_list); % Set mf2 to positions of observed variables in expanded state vector for filtering and smoothing. - bayestopt_.mf2 = var_obs_index; + bayestopt_.mf2 = var_obs_index_dr; bayestopt_.mfys = k1; oo_.dr.restrict_columns = [size(i_posA,1)+(1:size(M_.state_var,2))]; [k2, i_posA, i_posB] = union(k3p, M_.state_var', 'rows'); @@ -457,15 +457,15 @@ if options_.block == 1 bayestopt_.smoother_restrict_columns = ic; [junk,bayestopt_.smoother_mf] = ismember(k1, bayestopt_.smoother_var_list); else - k2 = union(var_obs_index,[M_.nstatic+1:M_.nstatic+M_.nspred]', 'rows'); + k2 = union(var_obs_index_dr,[M_.nstatic+1:M_.nstatic+M_.nspred]', 'rows'); % Set restrict_state to postion of observed + state variables in expanded state vector. oo_.dr.restrict_var_list = k2; % set mf0 to positions of state variables in restricted state vector for likelihood computation. [junk,bayestopt_.mf0] = ismember([M_.nstatic+1:M_.nstatic+M_.nspred]',k2); % Set mf1 to positions of observed variables in restricted state vector for likelihood computation. - [junk,bayestopt_.mf1] = ismember(var_obs_index,k2); + [junk,bayestopt_.mf1] = ismember(var_obs_index_dr,k2); % Set mf2 to positions of observed variables in expanded state vector for filtering and smoothing. - bayestopt_.mf2 = var_obs_index; + bayestopt_.mf2 = var_obs_index_dr; bayestopt_.mfys = k1; [junk,ic] = intersect(k2,nstatic+(1:npred)'); oo_.dr.restrict_columns = [ic; length(k2)+(1:nspred-npred)']; @@ -473,7 +473,7 @@ else [junk,junk,bayestopt_.smoother_saved_var_list] = intersect(k3,bayestopt_.smoother_var_list(:)); [junk,ic] = intersect(bayestopt_.smoother_var_list,nstatic+(1:npred)'); bayestopt_.smoother_restrict_columns = ic; - [junk,bayestopt_.smoother_mf] = ismember(var_obs_index, bayestopt_.smoother_var_list); + [junk,bayestopt_.smoother_mf] = ismember(var_obs_index_dr, bayestopt_.smoother_var_list); end; if options_.analytic_derivation,