Liking cljdoc? Tell your friends :D

org.replikativ.foerster.mechanism

Sample sites as structural equations x = f(u), u exogenous noise.

A distribution is read as a mechanism: noise draws u, push computes the value from it, abduct goes back from a value to its noise. For an invertible mechanism (location-scale, inverse CDF of a continuous law) abduction is exact. For a discrete one, many u give the same value, and abduct draws u from its posterior given the value — here under the inverse-CDF convention x = F⁻¹(u), u ~ U(0,1), under which that posterior is uniform on the value's CDF interval. Which convention a discrete site uses changes counterfactual answers and cannot be told from data, so it is fixed here and documented rather than guessed.

Parameters come from the distribution at the site, so replaying a site with its old u under new parents is the counterfactual value.

Sample sites as structural equations x = f(u), u exogenous noise.

A distribution is read as a mechanism: `noise` draws u, `push` computes the
value from it, `abduct` goes back from a value to its noise. For an
invertible mechanism (location-scale, inverse CDF of a continuous law)
abduction is exact. For a discrete one, many u give the same value, and
`abduct` draws u from its posterior given the value — here under the
inverse-CDF convention x = F⁻¹(u), u ~ U(0,1), under which that posterior is
uniform on the value's CDF interval. Which convention a discrete site uses
changes counterfactual answers and cannot be told from data, so it is fixed
here and documented rather than guessed.

Parameters come from the distribution at the site, so replaying a site with
its old u under new parents is the counterfactual value.
raw docstring

inverse-cdfclj/s

(inverse-cdf d)
(inverse-cdf d lower-cdf)

Explicit inverse-CDF mechanism for a law with working cdf/quantile. lower-cdf, when supplied, returns P(X < x) for a discrete law. Without it the law is interpreted as continuous. Category ordering is part of this structural assumption. Unsupported quantiles fail explicitly.

Explicit inverse-CDF mechanism for a law with working cdf/quantile.
`lower-cdf`, when supplied, returns P(X < x) for a discrete law. Without
it the law is interpreted as continuous. Category ordering is part of
this structural assumption. Unsupported quantiles fail explicitly.
sourceraw docstring

mechanismclj/s

(mechanism d {:keys [noise push abduct]})

Give distribution d an explicit structural interpretation. ops has zero-argument :noise, one-argument :push and one-argument :abduct functions. :abduct samples the conditional noise, not an arbitrary inverse. These functions declare the coupling across interventions; the density alone does not determine it.

Give distribution `d` an explicit structural interpretation. `ops` has
zero-argument :noise, one-argument :push and one-argument :abduct functions.
:abduct samples the conditional noise, not an arbitrary inverse. These
functions declare the coupling across interventions; the density alone
does not determine it.
sourceraw docstring

mechanism?clj/s

(mechanism? d)

Whether distribution d can be read as a mechanism.

Whether distribution `d` can be read as a mechanism.
sourceraw docstring

PMechanismclj/sprotocol

abductclj/s

(abduct d x)

Noise that gives value x: exact when the mechanism is invertible, a draw from the posterior over u otherwise.

Noise that gives value `x`: exact when the mechanism is
invertible, a draw from the posterior over u otherwise.

noiseclj/s

(noise d)

A fresh draw of the site's exogenous noise.

A fresh draw of the site's exogenous noise.

pushclj/s

(push d u)

The value the mechanism gives noise u.

The value the mechanism gives noise `u`.
source

shiftedclj/s

(shifted d delta)

Translate a law, preserving its noise coordinate when it is a mechanism.

Translate a law, preserving its noise coordinate when it is a mechanism.
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