Commit 8a56ed35 authored by ratto's avatar ratto
Browse files

1) Still some errors in dsgelikelihood are present that are not trapped: use...

1) Still some errors in dsgelikelihood are present that are not  trapped: use try catch when evaluating target function;
2) proposal density should contain the jscale.

git-svn-id: https://www.dynare.org/svn/dynare/trunk@3077 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 0a5a131e
......@@ -83,13 +83,17 @@ for b = fblck:nblck,
while j <= nruns(b)
par = feval(ProposalFun, xparam1, d * jscale, n);
if all( par(:) > mh_bounds(:,1) ) & all( par(:) < mh_bounds(:,2) )
try
logpost = - feval(TargetFun, par(:),varargin{:});
catch,
logpost = -inf;
end
else
logpost = -inf;
end
r = logpost - ilogpo2(b) + ...
log(feval(ProposalDensity, ix2(b,:), xparam1, d, n)) - ...
log(feval(ProposalDensity, par, xparam1, d, n));
log(feval(ProposalDensity, ix2(b,:), xparam1, d * jscale, n)) - ...
log(feval(ProposalDensity, par, xparam1, d * jscale, n));
if (logpost > -inf) && (log(rand) < r)
x2(irun,:) = par;
ix2(b,:) = par;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment