I see that in dynare_estimation you have the following piece of code
- Code: Select all
if any(xparam1 < bounds(:,1)) | any(xparam1 > bounds(:,2))
find(xparam1 < bounds(:,1))
find(xparam1 > bounds(:,2))
error('Initial parameter values are outside parameter bounds')
end
I would suggest to give more information to the user than just printing out numbers. Why don't you replace it with
- Code: Select all
if any(xparam1 < bounds(:,1)) | any(xparam1 > bounds(:,2))
xlb=find(xparam1 < bounds(:,1));
xub=find(xparam1 > bounds(:,2));
disp('parameters violating the lower bound')
fprintf('number \t value \t lower bound\n')
fprintf('%5.0f\t %5.5f \t %5.5f\n', xlb,xparam1(xlb),bounds(xlb,1))
disp('parameters violating the upper bound')
fprintf('number \t value \t upper bound\n')
fprintf('%5.0f\t %5.5f \t %5.5f\n', xub,xparam1(xub),bounds(xub,2))
error('Initial parameter values are outside parameter bounds')
end
Best
Gianni