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.
(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.
(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.
(mechanism? d)Whether distribution d can be read as a mechanism.
Whether distribution `d` can be read as a mechanism.
(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.
(noise d)A fresh draw of the site's exogenous noise.
A fresh draw of the site's exogenous noise.
(push d u)The value the mechanism gives noise u.
The value the mechanism gives noise `u`.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |