Bug fix for mode_compute=6.

We did not keep track of the first and second order moment when calling gmhmaxlik_core.
bgp-dev
Stéphane Adjemian (Ryûk) 2022-08-31 13:06:30 +02:00
parent 982ec2e66d
commit e5102eeefd
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 1 additions and 1 deletions

View File

@ -149,6 +149,7 @@ j = 1;
isux = 0;
ilogpo2 = - feval(ObjFun,ix2,varargin{:});
while j<= NumberOfIterations
j = j+1;
proposal = iScale*dd*randn(npar,1) + ix2;
if all(proposal > mh_bounds(:,1)) && all(proposal < mh_bounds(:,2))
logpo2 = - feval(ObjFun,proposal,varargin{:});
@ -175,7 +176,6 @@ while j<= NumberOfIterations
MeanPar = oldMeanPar + (1/j)*(ix2-oldMeanPar);
CovJump = CovJump + oldMeanPar*oldMeanPar' - MeanPar*MeanPar' + ...
(1/j)*(ix2*ix2' - CovJump - oldMeanPar*oldMeanPar');
j = j+1;
end
dyn_waitbar_close(hh);
PostVar = CovJump;