Rewrote the error message issued when the prefilter option in used while the steady state of the observed variables is non zero (introduced in commit d82252e805).

time-shift
Stéphane Adjemian (Scylla) 2014-01-30 17:57:36 +01:00
parent f1e4ca2f48
commit 7864e0ec82
1 changed files with 8 additions and 6 deletions

View File

@ -85,7 +85,7 @@ if options_.lik_init == 1
if isempty(options_.qz_criterium) if isempty(options_.qz_criterium)
options_.qz_criterium = 1-1e-6; options_.qz_criterium = 1-1e-6;
elseif options_.qz_criterium > 1-eps elseif options_.qz_criterium > 1-eps
error(['estimation: option qz_criterium is too large for estimating ' ... error(['Estimation: option qz_criterium is too large for estimating ' ...
'a stationary model. If your model contains unit roots, use ' ... 'a stationary model. If your model contains unit roots, use ' ...
'option diffuse_filter']) 'option diffuse_filter'])
end end
@ -274,7 +274,7 @@ end
if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model) if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model)
if ~options_.smoother if ~options_.smoother
error('ESTIMATION: the ''estimated_params'' block is mandatory (unless you are running a smoother)') error('Estimation: the ''estimated_params'' block is mandatory (unless you are running a smoother)')
end end
xparam1 = []; xparam1 = [];
bayestopt_.lb = []; bayestopt_.lb = [];
@ -494,10 +494,12 @@ else
options_.noconstant = 0; options_.noconstant = 0;
% If the data are prefiltered then there must not be constants in the % If the data are prefiltered then there must not be constants in the
% measurement equation of the DSGE model or in the DSGE-VAR model. % measurement equation of the DSGE model or in the DSGE-VAR model.
if options_.prefilter == 1 if options_.prefilter
fprintf('\nestimation_init: You have specified the option "prefilter" to demean your data,\n') skipline()
fprintf('estimation_init: but your observation equations are not mean zero. Either change your observation\n') disp('You have specified the option "prefilter" to demean your data but the')
fprintf('estimation_init: equation or drop the prefiltering.\n') disp('steady state of of the observed variables is non zero.')
disp('Either change the measurement equations, by centering the observed')
disp('variables in the model block, or drop the prefiltering.')
error('The option "prefilter" is inconsistent with the non-zero mean measurement equations in the model.') error('The option "prefilter" is inconsistent with the non-zero mean measurement equations in the model.')
end end
end end