Liking cljdoc? Tell your friends :D
All platforms.

org.replikativ.foerster.involutive

Involutive MCMC over savepoint traces (Neklyudov et al. 2020; Gen's involutive_mh).

A move draws auxiliary variables u ~ q(· ; x) from the current choices x, maps (x, u) through an involution h to (x', u'), replays the program with x', and accepts with

log α = log p(x') − log p(x) + log q(u' ; x') − log q(u ; x) + log |det ∂h/∂(x,u)|

Random-walk, scale, swap and data-driven moves are all such pairs (q, h). The Jacobian term is the caller's (:log-jacobian from the involution); fd-log-jacobian computes it numerically for real-valued maps — raster's AD is the intended replacement.

Moves may change the set of sites (reversible jump; Green 1995): the involution sets the sites of the new dimension through :choices (new addresses included) and names under :removed the sites whose values it moved into the auxiliary variables — those are part of the state, not dropped. A site the replay reaches afresh without the involution setting it is drawn from its prior, and one it no longer reaches and that is not :removed is dropped, both scored as in single-site MH.

Involutive MCMC over savepoint traces (Neklyudov et al. 2020; Gen's
`involutive_mh`).

A move draws auxiliary variables u ~ q(· ; x) from the current choices x,
maps (x, u) through an involution h to (x', u'), replays the program with
x', and accepts with

  log α = log p(x') − log p(x) + log q(u' ; x') − log q(u ; x) + log |det ∂h/∂(x,u)|

Random-walk, scale, swap and data-driven moves are all such pairs (q, h).
The Jacobian term is the caller's (`:log-jacobian` from the involution);
`fd-log-jacobian` computes it numerically for real-valued maps — raster's AD
is the intended replacement.

Moves may change the set of sites (reversible jump; Green 1995): the
involution sets the sites of the new dimension through `:choices` (new
addresses included) and names under `:removed` the sites whose values it
moved into the auxiliary variables — those are part of the state, not
dropped. A site the replay reaches afresh without the involution setting
it is drawn from its prior, and one it no longer reaches and that is not
`:removed` is dropped, both scored as in single-site MH.
raw docstring

fd-log-jacobianclj/s

(fd-log-jacobian f v)
(fd-log-jacobian f v eps)

log |det ∂f/∂v| at v by central differences, for f from vectors of reals to vectors of the same length.

log |det ∂f/∂v| at `v` by central differences, for `f` from vectors of
reals to vectors of the same length.
sourceraw docstring

stepclj/s

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

One involutive MH move on trace.

:propose (fn [choices]) -> {:aux u :log-q log q(u ; x)} :log-q (fn [choices u]) -> log q(u ; x), for the reverse move :involution (fn [choices u]) -> {:choices x' :aux u' :log-jacobian l :removed #{address}} where x' gives new values for some addresses of choices (or for addresses of a new dimension), and :removed names the sites of the old dimension it moved into u' (reversible jump; default none)

choices is foerster.trace/choices of the trace ({address value}). Resolves {:trace t :accepted? b :log-ratio r}; the loser's worlds are given back.

One involutive MH move on `trace`.

  :propose    (fn [choices]) -> {:aux u :log-q log q(u ; x)}
  :log-q      (fn [choices u]) -> log q(u ; x), for the reverse move
  :involution (fn [choices u]) -> {:choices x' :aux u' :log-jacobian l
                                   :removed #{address}}
              where x' gives new values for some addresses of `choices`
              (or for addresses of a new dimension), and :removed names
              the sites of the old dimension it moved into u'
              (reversible jump; default none)

`choices` is `foerster.trace/choices` of the trace ({address value}).
Resolves {:trace t :accepted? b :log-ratio r}; the loser's worlds are
given back.
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