pymc.step_methods.Slice#

class pymc.step_methods.Slice(*args, **kwargs)[source]#

Univariate slice sampler step method.

Parameters:
varslist, optional

List of value variables for sampler.

wfloat, default 1.0

Initial width of slice.

tunebool, default True

Flag for tuning.

modelModel, optional

Optional model for sampling step. It will be taken from the context if not provided.

max_stepsint, default 100

Maximum interval width as a multiple of w. Must be a positive integer. At most max_steps - 1 stepping-out expansions are performed per coordinate, randomly divided between the left and right endpoints. Sampling and shrinkage proceed when this budget is exhausted, even if an endpoint is still inside the slice. The budget applies during both tuning and sampling. Set to 1 to disable stepping out.

rng: RandomGenerator

An object that can produce be used to produce the step method’s Generator object. Refer to pymc.util.get_random_generator() for more information.

References

[1]

Neal, R. M. (2003). Slice sampling. The Annals of Statistics, 31(3), 705-767. Stepping-out and shrinkage procedures in Figures 3 and 5. https://doi.org/10.1214/aos/1056562461

Methods

Slice.__init__([vars, w, tune, model, ...])

Create the ArrayStepShared object.

Slice.astep(apoint)

Perform a single sample step in a raveled and concatenated parameter space.

Slice.competence(var, has_grad)

Slice.setup_chain(rng, tune, draws)

Prepare the step method for sampling one chain.

Slice.step(point)

Perform a single step of the sampler.

Slice.stop_tuning()

Attributes

default_blocked

default_tune_steps

Number of default tuning steps this step method needs.

name

sampling_state

stats_dtypes

A list containing <=1 dictionary that maps stat names to dtypes.

stats_dtypes_shapes

Maps stat names to dtypes and shapes.

vars

Variables that the step method is assigned to.