Make calib_smoother command call evaluate_smoother matlab routine.

time-shift
Stéphane Adjemian (Charybdis) 2013-06-28 11:14:24 +02:00
parent 664997eec8
commit 5d56a4f2b0
2 changed files with 11 additions and 13 deletions

View File

@ -86,9 +86,9 @@ if ischar(parameters)
end
end
pshape_original = bayestopt_.pshape;
bayestopt_.pshape = Inf(size(bayestopt_.pshape));
clear('priordens')
%pshape_original = bayestopt_.pshape;
%bayestopt_.pshape = Inf(size(bayestopt_.pshape));
%clear('priordens')
[atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] = ...
DsgeSmoother(parameters,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
@ -111,18 +111,17 @@ if options_.nk ~= 0
decomp(options_.filter_step_ahead,i_endo,:,:);
end
end
dr = oo_.dr;
order_var = oo_.dr.order_var;
for i=bayestopt_.smoother_saved_var_list'
i1 = order_var(bayestopt_.smoother_var_list(i));
eval(['oo.SmoothedVariables.' deblank(M_.endo_names(i1,:)) ' = atT(i,:)'';']);
eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
if options_.nk>0
eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
end
eval(['oo.UpdatedVariables.' deblank(M_.endo_names(i1,:)) ' = updated_variables(i,:)'';']);
end
for i=1:M_.exo_nbr
eval(['oo.SmoothedShocks.' deblank(M_.exo_names(i,:)) ' = innov(i,:)'';']);
end
oo.dr = oo_.dr;
bayestopt_.pshape = pshape_original;
%oo.dr = oo_.dr;
%bayestopt_.pshape = pshape_original;

View File

@ -2412,10 +2412,9 @@ CalibSmootherStatement::writeOutput(ostream &output, const string &basename) con
{
options_list.writeOutput(output);
symbol_list.writeOutput("var_list_", output);
output << "options_.mode_compute = 0;" << endl
<< "options_.smoother = 1;" << endl
<< "options_.order = 1;" << endl
<< "dynare_estimation(var_list_);" << endl;
output << "options_.smoother = 1;" << endl;
output << "options_.order = 1;" << endl;
output << "evaluate_smoother('calibration',var_list_);" << endl;
}
ExtendedPathStatement::ExtendedPathStatement(const OptionsList &options_list_arg)