Liking cljdoc? Tell your friends :D

org.replikativ.foerster.moves.pair

Moves with auxiliary randomness, in one shape: a forward kernel that draws an auxiliary value and maps the state, and a backward kernel that scores the auxiliary value the reverse move would draw.

forward (fn [choices trace]) -> {:updates x' :log-q lq :reverse u' :log-jacobian lj} x' new values for some addresses (earlier ones included), lq the log density of the forward kernel's own draws, u' the auxiliary value the backward kernel would draw to go back, lj the log |det| of the deterministic map (0.0 for a discrete or volume-preserving move; required) backward (fn [choices' u']) -> log L(u' ; x')

choices is foerster.runtime.trace/choices ({address value}). The forward kernel draws from foerster.random (it runs in the particle's stream). A pair is SMCP3's move-reweight step (foerster.inference.smc, :smcp3) and a population transport (foerster.program/transport-kernel); an involutive MH move (foerster.moves.involutive) is the case whose map is an involution and whose backward kernel is the forward one, and from-involution makes it a pair. Valid laws and the Jacobian are the caller's obligation; they are not inferred.

Moves with auxiliary randomness, in one shape: a forward kernel that
draws an auxiliary value and maps the state, and a backward kernel that
scores the auxiliary value the reverse move would draw.

  forward   (fn [choices trace]) -> {:updates x' :log-q lq :reverse u'
                                     :log-jacobian lj}
            x' new values for some addresses (earlier ones included), lq
            the log density of the forward kernel's own draws, u' the
            auxiliary value the backward kernel would draw to go back, lj
            the log |det| of the deterministic map (0.0 for a discrete or
            volume-preserving move; required)
  backward  (fn [choices' u']) -> log L(u' ; x')

`choices` is `foerster.runtime.trace/choices` ({address value}). The
forward kernel draws from `foerster.random` (it runs in the particle's
stream). A pair is SMCP3's move-reweight step (`foerster.inference.smc`,
`:smcp3`) and a population transport (`foerster.program/transport-kernel`);
an involutive MH move (`foerster.moves.involutive`) is the case whose map
is an involution and whose backward kernel is the forward one, and
`from-involution` makes it a pair. Valid laws and the Jacobian are the
caller's obligation; they are not inferred.
raw docstring

check!clj/s

(check! x what)

x if it is a pair, else an error naming what takes.

`x` if it is a pair, else an error naming `what` takes.
sourceraw docstring

from-involutionclj/s

(from-involution {:keys [propose log-q involution]})

The pair of an involutive move {:propose (fn [choices]) -> {:aux u :log-q}, :log-q (fn [choices u]), :involution (fn [choices u]) -> {:choices x' :aux u' :log-jacobian l}}: forward draws u and applies the involution, backward is q at the new state. So one move serves as an MCMC move (k/involutive-kernel) and as an SMCP3 step. A reversible jump (an involution that names :removed sites) stays an MCMC move only.

The pair of an involutive move {:propose (fn [choices]) -> {:aux u :log-q},
:log-q (fn [choices u]), :involution (fn [choices u]) -> {:choices x' :aux
u' :log-jacobian l}}: forward draws u and applies the involution, backward
is q at the new state. So one move serves as an MCMC move
(`k/involutive-kernel`) and as an SMCP3 step. A reversible jump (an
involution that names `:removed` sites) stays an MCMC move only.
sourceraw docstring

pairclj/s

(pair forward backward)

The move of forward and backward (see the namespace).

The move of `forward` and `backward` (see the namespace).
sourceraw docstring

pair?clj/s

(pair? x)

Whether x is a pair, or a map with :forward and :backward functions (the shape SMCP3 and transport take).

Whether `x` is a pair, or a map with `:forward` and `:backward`
functions (the shape SMCP3 and transport take).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close