changed variable name to make clear that, for multinormal variables, we are using the Cholesky decomposition of the covariance matrix.
parent
c1cb452e3d
commit
e04a07c771
|
@ -121,12 +121,12 @@ end
|
||||||
if any(isnan(bayestopt_.jscale))
|
if any(isnan(bayestopt_.jscale))
|
||||||
if exist([ModelName '_optimal_mh_scale_parameter.mat'])% This file is created by mode_compute=6.
|
if exist([ModelName '_optimal_mh_scale_parameter.mat'])% This file is created by mode_compute=6.
|
||||||
load([ModelName '_optimal_mh_scale_parameter'])
|
load([ModelName '_optimal_mh_scale_parameter'])
|
||||||
proposal_covariance = d*Scale;
|
proposal_covariance_Choleksy_decomposition = d*Scale;
|
||||||
else
|
else
|
||||||
error('mh:: Something is wrong. I can''t figure out the value of the scale parameter.')
|
error('mh:: Something is wrong. I can''t figure out the value of the scale parameter.')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
proposal_covariance = d*diag(bayestopt_.jscale);
|
proposal_covariance_Cholesky_decomposition = d*diag(bayestopt_.jscale);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ for b = fblck:nblck,
|
||||||
irun = fline(b);
|
irun = fline(b);
|
||||||
j = 1;
|
j = 1;
|
||||||
while j <= nruns(b)
|
while j <= nruns(b)
|
||||||
par = feval(ProposalFun, ix2(b,:), proposal_covariance, n);
|
par = feval(ProposalFun, ix2(b,:), proposal_covariance_Cholesky_decomposition, n);
|
||||||
if all( par(:) > mh_bounds(:,1) ) & all( par(:) < mh_bounds(:,2) )
|
if all( par(:) > mh_bounds(:,1) ) & all( par(:) < mh_bounds(:,2) )
|
||||||
try
|
try
|
||||||
logpost = - feval(TargetFun, par(:),varargin{:});
|
logpost = - feval(TargetFun, par(:),varargin{:});
|
||||||
|
|
Loading…
Reference in New Issue