improvements to the stochastic posterior mode optimization routine (mode_compute = 6)
git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1091 ac1d8469-bf42-47a9-8791-bf33cf982152time-shift
parent
b36a248d85
commit
5b2053c347
|
@ -357,18 +357,25 @@ if options_.mode_compute > 0 & options_.posterior_mode_estimation
|
||||||
if exist('hh')
|
if exist('hh')
|
||||||
CovJump = inv(hh);
|
CovJump = inv(hh);
|
||||||
else% The covariance matrix is initialized with the prior
|
else% The covariance matrix is initialized with the prior
|
||||||
% covariance (a diagonal matrix) % Except for infinite variances ;-)
|
% covariance (a diagonal matrix) %%Except for infinite variances ;-)
|
||||||
stdev = bayestopt_.pstdev;
|
varinit = 'prior';
|
||||||
indx = find(isinf(stdev));
|
if strcmpi(varinit,'prior')
|
||||||
stdev(indx) = ones(length(indx),1)*0.1;
|
stdev = bayestopt_.pstdev;
|
||||||
indx = find(stdev>2);
|
indx = find(isinf(stdev));
|
||||||
stdev(indx) = ones(length(indx),1)*0.1;
|
stdev(indx) = ones(length(indx),1)*sqrt(10);
|
||||||
CovJump = diag(stdev).^2;
|
vars = stdev.^2;
|
||||||
CovJump = eye(length(stdev))*0.5;
|
CovJump = diag(vars);
|
||||||
|
elseif strcmpi(varinit,'eye')
|
||||||
|
vars = ones(length(bayestopt_.pstdev),1)*0.1;
|
||||||
|
CovJump = diag(vars);
|
||||||
|
else
|
||||||
|
disp('gmhmaxlik :: Error!')
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
OldPostVar = CovJump;
|
OldPostVar = CovJump;
|
||||||
Scale = options_.mh_jscale;
|
Scale = options_.mh_jscale;
|
||||||
for i=1:options_.Opt6Iter
|
for i=1:options_.Opt6Iter
|
||||||
if i == 1
|
if i == 1
|
||||||
if options_.Opt6Iter > 1
|
if options_.Opt6Iter > 1
|
||||||
flag = '';
|
flag = '';
|
||||||
|
|
|
@ -107,7 +107,9 @@ while j<=MaxNumberOfTuningSimulations
|
||||||
test1 = jsux/jj;
|
test1 = jsux/jj;
|
||||||
cfactor = test1/AcceptanceTarget;
|
cfactor = test1/AcceptanceTarget;
|
||||||
if cfactor>0
|
if cfactor>0
|
||||||
iScale = iScale*cfactor;
|
iScale = iScale*cfactor;
|
||||||
|
else
|
||||||
|
iScale = iScale/10;
|
||||||
end
|
end
|
||||||
jsux = 0; jj = 0;
|
jsux = 0; jj = 0;
|
||||||
if cfactor>0.90 && cfactor<1.10
|
if cfactor>0.90 && cfactor<1.10
|
||||||
|
|
Loading…
Reference in New Issue