Save prior structure (bayestopt_) in M_.dname/prior/definition.mat, if the prior is changed.
git-svn-id: https://www.dynare.org/svn/dynare/trunk@2754 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
cbbaf112e3
commit
b71a7a83ed
|
@ -221,4 +221,38 @@ function [xparam1, estim_params_, bayestopt_, lb, ub, M_]=set_prior(estim_params
|
|||
end
|
||||
|
||||
k = find(isnan(xparam1));
|
||||
xparam1(k) = bayestopt_.p1(k);
|
||||
xparam1(k) = bayestopt_.p1(k);
|
||||
|
||||
CheckPath('prior');
|
||||
|
||||
if exist([ M_.dname '/prior/definition.mat'])
|
||||
bayestopt_old = load([M_.dname '/prior/definition.mat'],'bayestopt_');
|
||||
prior_has_changed = 0;
|
||||
if any(bayestopt_.p1-bayestopt_old.p1)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p2-bayestopt_old.p2)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p3-bayestopt_old.p3)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p4-bayestopt_old.p4)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p5-bayestopt_old.p5)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p6-bayestopt_old.p6)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if any(bayestopt_.p7-bayestopt_old.p7)
|
||||
prior_has_changed = 1;
|
||||
end
|
||||
if prior_has_changed
|
||||
delete([M_.dname '/prior/definition.mat']);
|
||||
save([M_.dname '/prior/definition.mat'],'bayestopt_');
|
||||
end
|
||||
else
|
||||
save([M_.dname '/prior/definition.mat'],'bayestopt_');
|
||||
end
|
Loading…
Reference in New Issue