2016-06-16 10:38:40 +02:00
|
|
|
function l = isbayes(estim_params_)
|
|
|
|
|
|
|
|
% Returns true iff bayesian priors over parameters are defined.
|
|
|
|
|
2022-04-13 13:15:19 +02:00
|
|
|
% Copyright © 2016 Dynare Team
|
2016-06-16 10:38:40 +02:00
|
|
|
%
|
|
|
|
% This file is part of Dynare.
|
|
|
|
%
|
|
|
|
% Dynare is free software: you can redistribute it and/or modify
|
|
|
|
% it under the terms of the GNU General Public License as published by
|
|
|
|
% the Free Software Foundation, either version 3 of the License, or
|
|
|
|
% (at your option) any later version.
|
|
|
|
%
|
|
|
|
% Dynare is distributed in the hope that it will be useful,
|
|
|
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
% GNU General Public License for more details.
|
|
|
|
%
|
|
|
|
% You should have received a copy of the GNU General Public License
|
2021-06-09 17:33:48 +02:00
|
|
|
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
|
2016-06-16 10:38:40 +02:00
|
|
|
|
|
|
|
l = false;
|
|
|
|
|
|
|
|
if ~isstruct(estim_params_)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
if isempty(estim_params_)
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
ptypes = {'param_vals', 5; 'var_exo', 5 ; 'var_endo', 5; 'corrx', 6; 'corrn', 6};
|
|
|
|
|
|
|
|
for i=1:size(ptypes, 1)
|
|
|
|
if isfield(estim_params_, ptypes{i, 1})
|
|
|
|
tmp = estim_params_.(ptypes{i, 1});
|
|
|
|
if ~isempty(tmp)
|
|
|
|
if any(tmp(:,ptypes{i, 2})>0)
|
|
|
|
l = true;
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|