Commit b4e7e550 authored by MichelJuillard's avatar MichelJuillard

fixing bug with univariate filter

parent b5ae8356
......@@ -201,12 +201,12 @@ end
var_obs_index = [];
k1 = [];
for i=1:n_varobs
var_obs_index = [var_obs_index strmatch(deblank(options_.varobs(i,:)),M_.endo_names(dr.order_var,:),'exact')];
k1 = [k1 strmatch(deblank(options_.varobs(i,:)),M_.endo_names, 'exact')];
var_obs_index = [var_obs_index; strmatch(deblank(options_.varobs(i,:)),M_.endo_names(dr.order_var,:),'exact')];
k1 = [k1; strmatch(deblank(options_.varobs(i,:)),M_.endo_names, 'exact')];
end
% Define union of observed and state variables
k2 = union(var_obs_index',[dr.nstatic+1:dr.nstatic+dr.npred]', 'rows');
k2 = union(var_obs_index,[dr.nstatic+1:dr.nstatic+dr.npred]', '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.
......@@ -256,7 +256,7 @@ if options_.block == 1
[junk,bayestopt_.smoother_mf] = ismember(k1, ...
bayestopt_.smoother_var_list);
else
k2 = union(var_obs_index',[dr.nstatic+1:dr.nstatic+dr.npred]', 'rows');
k2 = union(var_obs_index,[dr.nstatic+1:dr.nstatic+dr.npred]', '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.
......
......@@ -78,7 +78,7 @@ if dataset_.missing.state
dataset_.missing.number_of_observations = n;
dataset_.missing.no_more_missing_observations = s;
else
dataset_.missing.aindex = num2cell(repmat(1:dataset_.info.nvobs,dataset_.info.ntobs,1),2);
dataset_.missing.aindex = num2cell(repmat(1:dataset_.info.nvobs,dataset_.info.ntobs,1)',1);
dataset_.missing.vindex = [];
dataset_.missing.number_of_observations = [];
dataset_.missing.no_more_missing_observations = [];
......
......@@ -34,7 +34,7 @@ end;
varobs dw dx dy z;
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0);
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,filtered_vars);
//checking smoother consistency
X = oo_.SmoothedVariables;
......
......@@ -35,7 +35,7 @@ end;
varobs dw dx dy z;
//estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,kalman_algo=2);
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algoH1_mode,kalman_algo=2);
estimation(datafile=data,first_obs=1000,nobs=200,mh_replic=0,mode_compute=0,mode_file=algoH1_mode,kalman_algo=2,filtered_vars);
//checking smoother consistency
X = oo_.SmoothedVariables;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment