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-bf33cf982152
time-shift
adjemian 2006-11-21 12:52:32 +00:00
parent b36a248d85
commit 5b2053c347
2 changed files with 19 additions and 10 deletions

View File

@ -357,18 +357,25 @@ if options_.mode_compute > 0 & options_.posterior_mode_estimation
if exist('hh')
CovJump = inv(hh);
else% The covariance matrix is initialized with the prior
% covariance (a diagonal matrix) % Except for infinite variances ;-)
stdev = bayestopt_.pstdev;
indx = find(isinf(stdev));
stdev(indx) = ones(length(indx),1)*0.1;
indx = find(stdev>2);
stdev(indx) = ones(length(indx),1)*0.1;
CovJump = diag(stdev).^2;
CovJump = eye(length(stdev))*0.5;
% covariance (a diagonal matrix) %%Except for infinite variances ;-)
varinit = 'prior';
if strcmpi(varinit,'prior')
stdev = bayestopt_.pstdev;
indx = find(isinf(stdev));
stdev(indx) = ones(length(indx),1)*sqrt(10);
vars = stdev.^2;
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
OldPostVar = CovJump;
Scale = options_.mh_jscale;
for i=1:options_.Opt6Iter
for i=1:options_.Opt6Iter
if i == 1
if options_.Opt6Iter > 1
flag = '';

View File

@ -107,7 +107,9 @@ while j<=MaxNumberOfTuningSimulations
test1 = jsux/jj;
cfactor = test1/AcceptanceTarget;
if cfactor>0
iScale = iScale*cfactor;
iScale = iScale*cfactor;
else
iScale = iScale/10;
end
jsux = 0; jj = 0;
if cfactor>0.90 && cfactor<1.10