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,14 +357,21 @@ 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 ;-)
|
||||||
|
varinit = 'prior';
|
||||||
|
if strcmpi(varinit,'prior')
|
||||||
stdev = bayestopt_.pstdev;
|
stdev = bayestopt_.pstdev;
|
||||||
indx = find(isinf(stdev));
|
indx = find(isinf(stdev));
|
||||||
stdev(indx) = ones(length(indx),1)*0.1;
|
stdev(indx) = ones(length(indx),1)*sqrt(10);
|
||||||
indx = find(stdev>2);
|
vars = stdev.^2;
|
||||||
stdev(indx) = ones(length(indx),1)*0.1;
|
CovJump = diag(vars);
|
||||||
CovJump = diag(stdev).^2;
|
elseif strcmpi(varinit,'eye')
|
||||||
CovJump = eye(length(stdev))*0.5;
|
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;
|
||||||
|
|
|
@ -108,6 +108,8 @@ while j<=MaxNumberOfTuningSimulations
|
||||||
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