package prbnmcn-dagger

  1. Overview
  2. Docs

Module Dagger.DistSource

Distributions

A distribution must be sampleable and must be associated to a density w.r.t. some base measure (which is kept implicit).

Sourcetype 'a dist = private {
  1. sample : RNG.t -> 'a;
  2. ll : 'a -> Log_space.t;
}

'a dist is the type of distributions on the type 'a.

Sourcetype 'a kernel = private {
  1. start : 'a;
  2. sample : 'a -> RNG.t -> 'a;
  3. ll : 'a -> 'a -> Log_space.t;
}

'a kernel is the type of kernels (ie random walks) on the type 'a.

Sourcetype 'a t = private
  1. | Stateless of 'a dist
  2. | Kernel of 'a kernel

A "distribution" as understood by this library is either a kernel or a plain distribution.

Sourceval stateless : (RNG.t -> 'a) -> ('a -> Log_space.t) -> 'a t

Create a distribution from a sampler and a log-density.

Sourceval kernel : 'a -> ('a -> RNG.t -> 'a) -> ('a -> 'a -> Log_space.t) -> 'a t

Create a kernel from an initial point, a kernel and its associated log-density.

Helpers for parameterized distributions and kernels.

Sourceval dist0 : (RNG.t -> 'a) -> ('a -> Log_space.t) -> 'a t
Sourceval dist1 : ('a -> RNG.t -> 'b) -> ('a -> 'b -> Log_space.t) -> 'a -> 'b t
Sourceval dist2 : ('a -> 'b -> RNG.t -> 'c) -> ('a -> 'b -> 'c -> Log_space.t) -> 'a -> 'b -> 'c t
Sourceval kernel1 : ('a -> 'b -> RNG.t -> 'b) -> ('a -> 'b -> 'b -> Log_space.t) -> 'b -> 'a -> 'b t

Combinators on distributions and kernels.

Sourceval iid : int -> 'a t -> 'a array t

iid n dist constructs the n-fold iid distribution where each component is distributed according to dist.

Sourceval conv : ('a -> 'b) -> ('b -> 'a) -> 'a t -> 'b t

conv f g dist transports a distribution along a pair of maps f,g. f,g must both be total. They need not be bijections, though not respecting this additional constraint might cause unspecified behaviours for some inference algorithms..

OCaml

Innovation. Community. Security.