Creating new types: overview

The basic steps involved to create custom types are described in the Getting Started page.

To handle more complicated cases, read the following:

Also consider transforming the problem of sampling your new type into a problem that can be handled using built-in sampler, which include:

  1. RealSliceSampler: implementation of the Slice Sampler (Neal, 2003) with doubling and shrinking. A fixed starting interval can also be provided if only the shrinking procedure is required (for example this second variant is used internally for simplex sampling in SimplexSampler).

  2. IntSliceSampler: which provides the same facilities as above but for integers. The fixed starting variant is used internally in categorical realization sampling, CategoricalSampler.

  3. MHSampler: an abstract class providing a basis for custom Metropolis-Hastings samplers. See blang.validation.internals.fixtures.IntNaiveSampler for an example.