Simulation of Exp-Abs-xy
Target distribution:
Gibbs:
Accept-Reject
using Distributionsa = 10
f(x, y) = exp( -abs(x) - a * abs(y-x) )
g(x, y) = exp(-a * abs(x-y))
function gibbs_ar(N::Int)
x = ones(N+1)
y = ones(N+1)
for i = 2:(N+1)
xstar = rand(Laplace(y[i-1], 1/a))
if rand() < f(xstar, y[i-1]) / g(xstar, y[i-1])
x[i] = xstar
else
x[i] = x[i-1]
end
ystar = rand(Laplace(x[i], 1/a))
if rand() < f(x[i], ystar) / g(x[i], ystar)
y[i] = ystar
else
y[i] = y[i-1]
end
end
return x, y
endInverse CDF
Refer to the handwritten supplementary for detailed derivation.
Slice Sampling
Then
It is straightforward to use the following Julia program to simulate.
Reference
Conditional distribution of $\exp(-|x|-|y|-a \cdot |x-y|)$ - Cross Validated
Last updated