Skip to content
Snippets Groups Projects
Commit 1a8382ad authored by Johannes Pfeifer's avatar Johannes Pfeifer Committed by Stéphane Adjemian
Browse files

OSR: add error indicator and suppress output if noprint options is specified

parent 7254767c
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,11 @@ for i=1:np
i_params(i) = strmatch(str{:}, M_.param_names, 'exact');
end
if ~options_.noprint
skipline()
disp('OPTIMAL SIMPLE RULE')
skipline()
end
osr_res = osr1(i_params,i_var,W);
stoch_simul(var_list);
\ No newline at end of file
......@@ -41,6 +41,7 @@ iyv = iyv(:);
iyr0 = find(iyv) ;
it_ = M_.maximum_lag + 1 ;
osr_res.error_indicator = 1; %initialize indicator
if M_.exo_nbr == 0
oo_.exo_steady_state = [] ;
......@@ -102,9 +103,11 @@ i_var=unique(i_var);
if info~=0
print_info(info, options_.noprint, options_);
else
if ~options_.noprint
fprintf('\nOSR: Initial value of the objective function: %g \n\n',loss);
end
if isinf(loss)
end
if ~options_.noprint && isinf(loss)
fprintf('\nOSR: The initial value of the objective function is infinite.\n');
fprintf('\nOSR: Check whether the unconditional variance of a target variable is infinite\n');
fprintf('\nOSR: due to the presence of a unit root.\n');
......@@ -136,6 +139,7 @@ for i=1:length(i_params)
osr_res.optim_params.(deblank(M_.param_names(i_params(i),:))) = p(i);
end
if ~options_.noprint
skipline()
disp('OPTIMAL VALUE OF THE PARAMETERS:')
skipline()
......@@ -144,4 +148,8 @@ for i=1:np
end
disp(sprintf('Objective function : %16.6g\n',f));
skipline()
end
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
if ~info
osr_res.error_indicator=0;
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment