Discretization
Reduction eliminates continuous nodes, so a continuous node's posterior cannot be recovered afterward. To keep evidence observable on a continuous node and to let it enter discrete inference, it can be discretized [1]: its support is partitioned at a list of edges into a discrete node plus a conditioned continuous remainder. The strategy is attached to the node and depends on its position:
a root carries an
ExactDiscretization: the discrete probabilities follow exactly from the node's distribution, because the marginal is known;a child carries an
ApproximatedDiscretization: the marginal is not generally available, so the tails are approximated (a uniform assumption over each bounded discretization-interval and an exponential assumption, whosescaleis the strategy's second argument, over an unbounded one).
Both strategies also carry two keyword settings, technique and mesh, which decide how the probability mass of a discretization-interval is obtained when the entry is a ProbabilityBox and are ignored otherwise; they are described under Imprecise node below.
Throughout, a discretization-interval means one cell of that partition — never an Interval entry, which is a different thing — and
Precise node
The scheme follows [1]. The node is replaced by a discrete surrogate, carrying one state per discretization-interval, and a continuous residual
The discrete surrogate. The probability of state
On a root this is exact,
The continuous residual. Which form the residual takes depends on the node's position, not on
A root conditions its own CDF on the discretization-interval, exactly:
A child cannot use the (unknown) marginal, so each bounded discretization-interval is filled with a uniform assumption,
and each unbounded tail with an exponential assumption of scale scale argument), pointing away from the discretization-interval's one finite edge. Above a lower edge
and, mirrored, below an upper edge
A larger
Tr = ContinuousNode(:Tr, Normal(), ExactDiscretization([-2.0, 0.0, 2.0])) # rootContinuousNode: Tr
Parents: none
Discretization: ExactDiscretization
Intervals: -2.0, 0.0, 2.0
Type: Precise
Support: [-Inf, Inf]
1×1 DataFrame
Row │ Π
│ Union…
─────┼───────────────────────────────
1 │ Normal{Float64}(μ=0.0, σ=1.0)# child: discretization-interval edges plus the exponential tail scale (here 1.5)
Cd = ContinuousNode(:Cd, [:W], ApproximatedDiscretization([-1.0, 0.0, 1.0], 1.5))ContinuousNode: Cd
Parents: W
Discretization: ApproximatedDiscretization
scale: 1.5
Intervals: -1.0, 0.0, 1.0
Type: Precise
0×2 DataFrame
Row │ W Π
│ Symbol Union…
─────┴────────────────Imprecise node
When the node is imprecise the same partition is used, and the split into surrogate and residual is the same; only the surrogate's probabilities change shape, becoming intervals rather than numbers.
The discrete surrogate. The mass wanted is the same,
This is the default, selected by technique = :optimised, and the two bounds are found by direct search over MeshAdaptiveDirectSearch), one member of the family at a time, down to a terminal mesh size of mesh. A smaller mesh is tighter and slower.
Evaluating one member at a time is what makes the result correct, and the two shortcuts one might reach for instead are both wrong. The p-box's own envelopes
When the family is not described by a parameter box, or the search is too slow, technique = :distribution_free differences opposite envelopes instead,
which is valid for any CDF lying between the envelopes. On a parametric p-box it therefore encloses the range above: never tighter, usually wider, and equal only on a discretization-interval where the two opposite envelopes happen to be attained by the same member — on a tail, say, where the mass is monotone in Interval only rejects a lower bound above its upper one, so a negative probability would otherwise pass. mesh is unused here.
Both settings live on the discretization strategy, so they are chosen per node, and both are consulted only for a probability-box entry — a precise distribution and a bare interval ignore them.
Parametric probability boxes only, for now
The only probability box that can be written as a node's entry is a parametric one: a ProbabilityBox is a distribution family plus a box of parameter values, so every member of it belongs to that family. A distribution-free box — any CDF running between two envelopes, with no family behind it — has no dedicated type yet; it is planned for UncertaintyQuantification.jl. Two things follow from that.
First, a continuous functional node fed by an imprecise parent produces exactly such a distribution-free object, which is why it is kept as a lower/upper pair of empirical CDFs and cannot itself be discretized — see Continuous Functional nodes.
Second, technique = :distribution_free is the method those boxes will need once they exist, because it assumes nothing beyond the envelopes. Until then every p-box reaching it is parametric, and on a parametric p-box it is always an enclosure rather than the answer: correct, cheaper, and no tighter than :optimised on any discretization-interval.
For a bare interval entry no CDF is available at all — only the support — so every discretization-interval receives the vacuous mass
Vacuous masses and conditioning
A node discretized from a bare interval is vacuous: masses of ProbabilityBox can narrow these mass intervals, but it avoids zero-probability extremes only when the lower mass of the observed discretization-interval is strictly positive.
The continuous residual. The formulas are exactly the ones given for a precise node, and as there it is the node's position that selects them — the entry's imprecision plays no part.
A root conditions its entry on the discretization-interval, which preserves whatever kind of entry it was: a distribution is truncated, a probability box is rebuilt on the narrower support and stays a box, and a bare Interval becomes the sub-interval
The asymmetry is deliberate: on a root the imprecision lives in both the surrogate probabilities and the residual; on a child it is pushed entirely into the surrogate's interval probabilities, leaving a precise residual. That is why an imprecise child feeding a functional node needs a single-loop simulation — the imprecision has moved into the discrete surrogate and no longer reaches the functional node as an input.
# imprecise root: an interval distribution, discretized exactly
Ti = ContinuousNode(:Ti, Interval(-2.0, 2.0), ExactDiscretization([-2.0, 0.0, 2.0]))ContinuousNode: Ti
Parents: none
Discretization: ExactDiscretization
Intervals: -2.0, 0.0, 2.0
Type: Imprecise
Support: [-2.0, 2.0]
1×1 DataFrame
Row │ Π
│ Union…
─────┼─────────────
1 │ [-2.0, 2.0]# imprecise child: an interval entry plus the exponential tail scale
Ci = ContinuousNode(:Ci, [:W], ApproximatedDiscretization([-1.0, 0.0, 1.0], 1.5))
Ci[:W => :sunny] = Interval(-1.0, 1.0)
CiContinuousNode: Ci
Parents: W
Discretization: ApproximatedDiscretization
scale: 1.5
Intervals: -1.0, 0.0, 1.0
Type: Imprecise
Support: [-1.0, 1.0]
1×2 DataFrame
Row │ W Π
│ Symbol Union…
─────┼─────────────────────
1 │ sunny [-1.0, 1.0]A probability-box root, whose discretization-interval masses are optimised over the parameter box at the default mesh:
pbox = ProbabilityBox{Normal}(Dict(:μ => Interval(0.0, 1.0), :σ => 1))
Tp = ContinuousNode(:Tp, pbox, ExactDiscretization([-1.0, 0.0, 1.0]))ContinuousNode: Tp
Parents: none
Discretization: ExactDiscretization
Intervals: -1.0, 0.0, 1.0
Type: Imprecise
Support: [-Inf, Inf]
1×1 DataFrame
Row │ Π
│ Union…
─────┼───────────────────────────────────
1 │ ProbabilityBox{Normal}(Dict{Symb…The same p-box taking the enclosure instead. A node reports these settings only when they depart from the defaults, so nothing extra appears above and a line does here; a non-default mesh shows up the same way:
Tf = ContinuousNode(:Tf, pbox, ExactDiscretization([-1.0, 0.0, 1.0]; technique = :distribution_free))ContinuousNode: Tf
Parents: none
Discretization: ExactDiscretization
Intervals: -1.0, 0.0, 1.0
P-box mass: distribution_free
Type: Imprecise
Support: [-Inf, Inf]
1×1 DataFrame
Row │ Π
│ Union…
─────┼───────────────────────────────────
1 │ ProbabilityBox{Normal}(Dict{Symb…