Changed penalties.
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1934 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
400267ab92
commit
7f927eff00
|
@ -47,17 +47,17 @@ cost_flag = 1;
|
||||||
|
|
||||||
if options_.mode_compute ~= 1 & any(xparam1 < bayestopt_.lb)
|
if options_.mode_compute ~= 1 & any(xparam1 < bayestopt_.lb)
|
||||||
k = find(xparam1 < bayestopt_.lb);
|
k = find(xparam1 < bayestopt_.lb);
|
||||||
fval = bayestopt_.penalty*min(1e3,exp(sum(bayestopt_.lb(k)-xparam1(k))));
|
fval = bayestopt_.penalty+sum((bayestopt_.lb(k)-xparam1(k)).^2);
|
||||||
info = 41;
|
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
|
info = 41;
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
if options_.mode_compute ~= 1 & any(xparam1 > bayestopt_.ub)
|
if options_.mode_compute ~= 1 & any(xparam1 > bayestopt_.ub)
|
||||||
k = find(xparam1 > bayestopt_.ub);
|
k = find(xparam1 > bayestopt_.ub);
|
||||||
fval = bayestopt_.penalty*min(1e3,exp(sum(xparam1(k)- bayestopt_.ub(k))));
|
fval = bayestopt_.penalty+sum((xparam1(k)-bayestopt_.ub(k)).^2);
|
||||||
info = 42;
|
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
|
info = 42;
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -83,9 +83,9 @@ M_.Sigma_e = Q;
|
||||||
dsge_prior_weight = M_.params(strmatch('dsge_prior_weight',M_.param_names));
|
dsge_prior_weight = M_.params(strmatch('dsge_prior_weight',M_.param_names));
|
||||||
% Is the DSGE prior proper?
|
% Is the DSGE prior proper?
|
||||||
if dsge_prior_weight<(NumberOfParameters+NumberOfObservedVariables)/gend;
|
if dsge_prior_weight<(NumberOfParameters+NumberOfObservedVariables)/gend;
|
||||||
fval = bayestopt_.penalty*min(1e3,(NumberOfParameters+NumberOfObservedVariables)/gend-dsge_prior_weight);
|
fval = bayestopt_.penalty+abs(gend*dsge_prior_weight-(NumberOfParameters+NumberOfObservedVariables));
|
||||||
info = 51;
|
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
|
info = 51;
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -97,11 +97,11 @@ end
|
||||||
bayestopt_.restrict_columns,...
|
bayestopt_.restrict_columns,...
|
||||||
bayestopt_.restrict_aux);
|
bayestopt_.restrict_aux);
|
||||||
if info(1) == 1 | info(1) == 2 | info(1) == 5
|
if info(1) == 1 | info(1) == 2 | info(1) == 5
|
||||||
fval = bayestopt_.penalty;
|
fval = bayestopt_.penalty+1;
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
return
|
return
|
||||||
elseif info(1) == 3 | info(1) == 4 | info(1) == 20
|
elseif info(1) == 3 | info(1) == 4 | info(1) == 20
|
||||||
fval = bayestopt_.penalty*min(1e3,exp(info(2)));
|
fval = bayestopt_.penalty+info(2)^2;
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -152,6 +152,7 @@ for i = 1:NumberOfLags-1
|
||||||
GXX = GXX + kron(tmp1,TheoreticalAutoCovarianceOfTheObservedVariables(:,:,i+1));
|
GXX = GXX + kron(tmp1,TheoreticalAutoCovarianceOfTheObservedVariables(:,:,i+1));
|
||||||
GXX = GXX + kron(tmp2,TheoreticalAutoCovarianceOfTheObservedVariables(:,:,i+1)');
|
GXX = GXX + kron(tmp2,TheoreticalAutoCovarianceOfTheObservedVariables(:,:,i+1)');
|
||||||
end
|
end
|
||||||
|
|
||||||
if ~options_.noconstant
|
if ~options_.noconstant
|
||||||
% Add one row and one column to GXX
|
% Add one row and one column to GXX
|
||||||
GXX = [GXX , kron(ones(NumberOfLags,1),constant') ; [ kron(ones(1,NumberOfLags),constant) , 1] ];
|
GXX = [GXX , kron(ones(NumberOfLags,1),constant') ; [ kron(ones(1,NumberOfLags),constant) , 1] ];
|
||||||
|
@ -171,7 +172,7 @@ if ~isinf(dsge_prior_weight)
|
||||||
if ~ispd(SIGMAu)
|
if ~ispd(SIGMAu)
|
||||||
v = diag(SIGMAu);
|
v = diag(SIGMAu);
|
||||||
k = find(v<0);
|
k = find(v<0);
|
||||||
fval = bayestopt_.penalty*min(1e3,exp(abs(v(k))));
|
fval = bayestopt_.penalty + sum(v(k).^2);
|
||||||
info = 52;
|
info = 52;
|
||||||
cost_flag = 0;
|
cost_flag = 0;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue