You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a bug in the ARS code that isn't apparent in the demo. Lines 86 and 91 of ars.m should be:
if log(U) <=lhVal-uhVal
and
elseiflog(U) <= func(x, varargin{:}) - uhVal
respectively, since we are working with log probs. This issue doesn't show up in arsDemo because eventually the grid of points becomes so dense that they overlap, but if you do not retain the grid points from sample to sample the issue is readily apparent.
To reproduce the bug with the current code, change example 1 arsDemo.m to
nSamples =20000;
sigma =1;
fprintf(sprintf('drawing %i samples from a 1D gaussian\n',nSamples));
% Take one sample at a time
samples = zeros(nSamples,1);
for s =1:nSamples
samples(s) = ars(func, a, b, domain, 1, sigma);
end
The text was updated successfully, but these errors were encountered:
There's a bug in the ARS code that isn't apparent in the demo. Lines 86 and 91 of ars.m should be:
and
respectively, since we are working with log probs. This issue doesn't show up in arsDemo because eventually the grid of points becomes so dense that they overlap, but if you do not retain the grid points from sample to sample the issue is readily apparent.
To reproduce the bug with the current code, change example 1 arsDemo.m to
The text was updated successfully, but these errors were encountered: