<s>
Slice	B-Algorithm
sampling	I-Algorithm
is	O
a	O
type	O
of	O
Markov	B-General_Concept
chain	I-General_Concept
Monte	I-General_Concept
Carlo	I-General_Concept
algorithm	O
for	O
pseudo-random	B-Algorithm
number	I-Algorithm
sampling	I-Algorithm
,	O
i.e.	O
</s>
<s>
Slice	B-Algorithm
sampling	I-Algorithm
,	O
in	O
its	O
simplest	O
form	O
,	O
samples	O
uniformly	O
from	O
underneath	O
the	O
curve	O
f(x )	O
without	O
the	O
need	O
to	O
reject	O
any	O
points	O
,	O
as	O
follows	O
:	O
</s>
<s>
It	O
is	O
often	O
possible	O
to	O
use	O
a	O
form	O
of	O
rejection	B-Algorithm
sampling	I-Algorithm
to	O
overcome	O
this	O
,	O
where	O
we	O
sample	O
from	O
a	O
larger	O
slice	O
that	O
is	O
known	O
to	O
include	O
the	O
desired	O
slice	O
in	O
question	O
,	O
and	O
then	O
discard	O
points	O
outside	O
of	O
the	O
desired	O
slice	O
.	O
</s>
<s>
whose	O
normalizing	O
constant	O
is	O
unknown	O
)	O
,	O
which	O
is	O
common	O
in	O
computational	B-Algorithm
statistics	I-Algorithm
.	O
</s>
<s>
Slice	B-Algorithm
sampling	I-Algorithm
gets	O
its	O
name	O
from	O
the	O
first	O
step	O
:	O
defining	O
a	O
slice	O
by	O
sampling	O
from	O
an	O
auxiliary	O
variable	O
.	O
</s>
<s>
Then	O
,	O
a	O
sample	O
can	O
be	O
drawn	O
from	O
the	O
slice	O
using	O
rejection	B-Algorithm
sampling	I-Algorithm
.	O
</s>
<s>
Slice	B-Algorithm
sampling	I-Algorithm
is	O
a	O
Markov	O
chain	O
method	O
and	O
as	O
such	O
serves	O
the	O
same	O
purpose	O
as	O
Gibbs	B-Algorithm
sampling	I-Algorithm
and	O
Metropolis	O
.	O
</s>
<s>
In	O
contrast	O
to	O
Metropolis	O
,	O
slice	B-Algorithm
sampling	I-Algorithm
automatically	O
adjusts	O
the	O
step	O
size	O
to	O
match	O
the	O
local	O
shape	O
of	O
the	O
density	O
function	O
.	O
</s>
<s>
Implementation	O
is	O
arguably	O
easier	O
and	O
more	O
efficient	O
than	O
Gibbs	B-Algorithm
sampling	I-Algorithm
or	O
simple	O
Metropolis	O
updates	O
.	O
</s>
<s>
Slice	B-Algorithm
Sampling	I-Algorithm
requires	O
that	O
the	O
distribution	O
to	O
be	O
sampled	O
be	O
evaluable	O
.	O
</s>
<s>
In	O
a	O
Gibbs	B-Algorithm
sampler	I-Algorithm
,	O
one	O
needs	O
to	O
draw	O
efficiently	O
from	O
all	O
the	O
full-conditional	O
distributions	O
.	O
</s>
<s>
When	O
sampling	O
from	O
a	O
full-conditional	O
density	O
is	O
not	O
easy	O
,	O
a	O
single	O
iteration	O
of	O
slice	B-Algorithm
sampling	I-Algorithm
or	O
the	O
Metropolis-Hastings	O
algorithm	O
can	O
be	O
used	O
within-Gibbs	O
to	O
sample	O
from	O
the	O
variable	O
in	O
question	O
.	O
</s>
<s>
If	O
the	O
full-conditional	O
density	O
is	O
log-concave	O
,	O
a	O
more	O
efficient	O
alternative	O
is	O
the	O
application	O
of	O
adaptive	B-Algorithm
rejection	I-Algorithm
sampling	I-Algorithm
(	O
ARS	O
)	O
methods	O
.	O
</s>
<s>
Single	O
variable	O
slice	B-Algorithm
sampling	I-Algorithm
can	O
be	O
used	O
in	O
the	O
multivariate	O
case	O
by	O
sampling	O
each	O
variable	O
in	O
turn	O
repeatedly	O
,	O
as	O
in	O
Gibbs	B-Algorithm
sampling	I-Algorithm
.	O
</s>
<s>
Reflective	O
slice	B-Algorithm
sampling	I-Algorithm
is	O
a	O
technique	O
to	O
suppress	O
random	O
walk	O
behavior	O
in	O
which	O
the	O
successive	O
candidate	O
samples	O
of	O
distribution	O
f(x )	O
are	O
kept	O
within	O
the	O
bounds	O
of	O
the	O
slice	O
by	O
"	O
reflecting	O
"	O
the	O
direction	O
of	O
sampling	O
inward	O
toward	O
the	O
slice	O
once	O
the	O
boundary	O
has	O
been	O
hit	O
.	O
</s>
<s>
Suppose	O
this	O
time	O
our	O
sample	O
yields	O
x	O
=	O
1	O
,	O
which	O
is	O
within	O
our	O
slice	O
,	O
and	O
thus	O
is	O
the	O
accepted	O
sample	O
output	O
by	O
slice	B-Algorithm
sampling	I-Algorithm
.	O
</s>
<s>
An	O
implementation	O
in	O
the	O
Macsyma	B-Language
language	O
is	O
:	O
</s>
