The first fix relates to bug https://github.com/probml/pmtk3/issues/61. The code is treating hull values as probabilities but they are computed in log space. This lead to higher acceptance rate. For example, with normal distribution:
The second bug was in the way how bounded distributions were treated. If the domain where a distribution is defined is not infinite, the area between initial points and boundaries of the interval was ignored. For example for Beta distribution which is defined on [0,1]:
function ys = funcBeta(xs)
a = 2; b = 5;
ys = (a - 1) .* log(xs) + (b - 1) .* log(1 - xs);
end
samples = ars(@funcBeta, 0.1, 0.8, [0, 1], 10000);
hist(samples,30);
There are two fixed bugs:
QQ plot shows that the resulting samples are not from the standard normal distribution.
With fix https://github.com/evelinag/pmtk3/commit/4f881a5132718281742e346d0bc2f09480e6cd45, the result looks as follows:
With fix https://github.com/evelinag/pmtk3/commit/a0e800f58429dac8fd8d9ec5e194ca7fe722661e,
ars
samples from the full interval.