Skip to content

Imprecision on a Continuous Node ​

The vehicle suspension example treats every input as precise. Here we revisit the same benchmark of Gerasimov & Vořechovský [22] — same model, loads and coefficients — but make the vehicle speed V imprecise: instead of a distribution, each road condition fixes V only to an interval (a p-box with unknown shape). This example shows how EnhancedBayesianNetworks propagates that imprecision, and — importantly — which simulation each modelling choice requires.

Two choices decide how the imprecision reaches the failure node and how it must be simulated:

  1. whether V carries a discretization, and

  2. whether the functional node is discrete (a reliability analysis) or continuous (a distribution/p-box that is reconstructed).

The four cases below walk through the combinations.

julia
using EnhancedBayesianNetworks

The shared model ​

The masses, gravity, road/load scenario nodes, the three precise suspension coefficients and the composite limit state are exactly those of the precise example; only V will change from case to case, so we define everything else once.

julia
M = 3.2633           # kg/cm/s²  (sprung mass)
m = 0.8158           # kg/cm/s²  (unsprung mass)
g = 981              # cm/s²     (gravity)

A = DiscreteNode(:A, [:road => [Parameter(0.15915, :A)], :offroad => [Parameter(0.8, :A)]])  # A in rad·cm²/m
A[:A => :road] = 0.7
A[:A => :offroad] = 0.3

b₀ = DiscreteNode(:b₀, [:normal_load => [Parameter(0.27, :b₀)], :over_load => [Parameter(0.5, :b₀)]])
b₀[:b₀ => :normal_load] = 0.7
b₀[:b₀ => :over_load] = 0.3

C = ContinuousNode(:C, Normal(431.7221, 10))     # kg/cm    (suspension stiffness)
Cₖ = ContinuousNode(:Cₖ, Normal(1475.5503, 10))   # kg/cm    (tire stiffness)
K = ContinuousNode(:K, Normal(55.0406, 10))       # kg/cm/s  (damping coefficient)

function composite_model(A, b₀, V, M, m, g, C, Cₖ, K)
    g1 = 1 .- (π .* m .* V .* A) ./ (b₀ .* K .* g .^ 2) .* [(Cₖ ./ (m .+ M) .- (C ./ M)) .^ 2 .+ C .^ 2 ./ (m .* M) .+ Cₖ .* K .^ 2 ./ (m .* M .^ 2)]
    g2 = 4000 .* C .* (M .* g) .^ (-1.5) .- 8.6394
    g3 = 2 .* .√(M .* g .* (K .^ 2 .* Cₖ ./ (C .* (m .+ M)) .+ C)) .- 1
    g4 = Cₖ .- [g .* (M .+ m)] .^ 0.877
    return minimum([g1[1], g2, g3, g4[1]])
end

model = Model(df -> composite_model.(df.A, df.b₀, df.V, M, m, g, df.C, df.Cₖ, df.K), :y)
performance = df -> df.y
#5 (generic function with 1 method)

V is imprecise: on a road its speed lies in [11, 13] m/s, off-road in [6, 8] m/s, with no assumed distribution inside those bands.

julia
v_road = Interval(11, 13)      # m/s
v_offroad = Interval(6, 8)     # m/s
[6, 8]

Case 1 — imprecise V, no discretization, feeding a discrete functional node: double-loop ​

When V is not discretized it reaches the failure node E as an imprecise continuous input. The reliability analysis at E therefore has to explore that imprecision, which is exactly what a DoubleLoop simulation does: an outer loop over the interval and an inner Monte-Carlo loop. The reduced network is credal, and E's own conditional probability table is interval-valued — a lower and upper failure probability per scenario.

julia
V = ContinuousNode(:V, [:A])
V[:A => :road] = v_road
V[:A => :offroad] = v_offroad

E = DiscreteFunctionalNode(:E, [model], performance, DoubleLoop(MonteCarlo(10^3)))

ebn = EnhancedBayesianNetwork([A, b₀, V, C, Cₖ, K, E])
add_child!(ebn, A, V)
add_child!(ebn, [A, b₀, V, C, Cₖ, K], E)
order!(ebn)

gplot(ebn, background_color = "white", legend = true, label_size = 10, legend_x = 15, legend_y = 14)

julia
elapsed = @elapsed cn = reduce(ebn)
println("network reduced in ", round(elapsed; digits = 3), " s")
network reduced in 2.065 s

The failure node's table now carries intervals — the bounds on the collapse probability for each road/load scenario:

julia
cn.nodes[findfirst(n -> n.name == :E, cn.nodes)].cpt.data
8×4 DataFrame
Rowb₀AEΠ
SymbolSymbolSymbolUnion…
1normal_loadroadE_failed[0.0, 0.003]
2normal_loadroadE_safe[0.997, 1.0]
3normal_loadoffroadE_failed[0.0, 0.004]
4normal_loadoffroadE_safe[0.996, 1.0]
5over_loadroadE_failed[0.0, 0.002]
6over_loadroadE_safe[0.998, 1.0]
7over_loadoffroadE_failed[0.0, 0.003]
8over_loadoffroadE_safe[0.997, 1.0]
julia
gplot(cn, background_color = "white", node_scale = 1.1, title = "Reduced Credal Network", label_size = 12)

Case 2 — imprecise V, discretized, feeding a discrete functional node: single-loop ​

Attaching an ApproximatedDiscretization to V changes the picture. During reduction an imprecise continuous node is split: its imprecision moves into the discrete surrogate V_d (whose bin probabilities become intervals — a credal node), while the continuous residual handed to E is approximated by a precise distribution. So E no longer sees any imprecise continuous input.

julia
discretization_v = ApproximatedDiscretization([6.0, 8.0, 10.0, 13.0], 2)  # edges in m/s

V = ContinuousNode(:V, [:A], discretization_v)
V[:A => :road] = v_road
V[:A => :offroad] = v_offroad

E = DiscreteFunctionalNode(:E, [model], performance, DoubleLoop(MonteCarlo(10^6)))

ebn = EnhancedBayesianNetwork([A, b₀, V, C, Cₖ, K, E])
add_child!(ebn, A, V)
add_child!(ebn, [A, b₀, V, C, Cₖ, K], E)
order!(ebn)

gplot(ebn, background_color = "white", legend = true, label_size = 10, legend_x = 15, legend_y = 14)

Because E's inputs are now precise, a DoubleLoop has nothing imprecise to loop over and the reduction raises an error. We catch it here to show the message:

julia
try
    reduce(ebn)
catch e
    showerror(stdout, e)
end
Invalid simulation for functional node :E: the assigned DoubleLoop is an imprecise (double-loop) simulation, but every input reaching :E is precise. There are two ways to get here. Either an imprecise continuous ancestor of :E was discretized: discretization moves the imprecision into the discrete (credal) surrogate node and leaves a precise continuous residual feeding :E, so use a single-loop simulation (e.g. MonteCarlo) for :E and the network stays credal through the discretized node, or remove the discretization from the ancestor so its imprecision reaches :E directly. Or a continuous ancestor was given as a ProbabilityBox whose every interval parameter has zero width: that describes a single distribution, so it is stored as that distribution and no imprecision ever reaches :E. Use a single-loop simulation for :E, or widen a parameter interval if that ancestor was meant to be imprecise.

Single-loop after discretizing an imprecise child node

When the only imprecision feeding a functional node comes from a non-root imprecise continuous ancestors that are discretized, use a single-loop simulation (e.g. MonteCarlo). Discretization has already carried the imprecision into the credal discrete surrogate; the residual reaching the functional node is precise, so a double loop is neither needed nor valid.

Swapping the simulation to a single-loop MonteCarlo fixes it. The imprecision is not lost — it now lives in the credal V_d, so the reduced network is still a CredalNetwork:

julia
V = ContinuousNode(:V, [:A], discretization_v)
V[:A => :road] = v_road
V[:A => :offroad] = v_offroad

E = DiscreteFunctionalNode(:E, [model], performance, MonteCarlo(10^6))

ebn = EnhancedBayesianNetwork([A, b₀, V, C, Cₖ, K, E])
add_child!(ebn, A, V)
add_child!(ebn, [A, b₀, V, C, Cₖ, K], E)
order!(ebn)

elapsed = @elapsed cn = reduce(ebn)
println("network reduced in ", round(elapsed; digits = 3), " s")
network reduced in 4.168 s
julia
gplot(cn, background_color = "white", node_scale = 1.1, title = "Reduced Credal Network", label_size = 12)

Case 3 — imprecise V, no discretization, feeding a continuous functional node: MonteCarlo ​

When the functional node is continuous rather than discrete, imprecision is handled differently again. Leaving V imprecise (no discretization), a ContinuousFunctionalNode propagates it with an ordinary MonteCarlo and reconstructs the output as a probability box — a lower/upper distribution pair. Continuous functional nodes have no double-loop variant, so a single-loop MonteCarlo is the right (and only) choice: this is the continuous counterpart of Case 1.

julia
V = ContinuousNode(:V, [:A])
V[:A => :road] = v_road
V[:A => :offroad] = v_offroad

E = ContinuousFunctionalNode(:E, [model], MonteCarlo(10^6))

ebn = EnhancedBayesianNetwork([A, b₀, V, C, Cₖ, K, E])
add_child!(ebn, A, V)
add_child!(ebn, [A, b₀, V, C, Cₖ, K], E)
order!(ebn)

gplot(ebn, background_color = "white", legend = true, label_size = 10, legend_x = 15, legend_y = 14)

julia
elapsed = @elapsed cn = reduce(ebn)
println("network reduced in ", round(elapsed; digits = 3), " s")
network reduced in 6.333 s
julia
gplot(cn, background_color = "white", node_scale = 1.1, title = "Reduced Credal Network", label_size = 12)

The failure node is now a continuous node whose entries are :lb/:ub EmpiricalDistribution pairs — the reconstructed p-box:

julia
cn.nodes[findfirst(n -> n.name == :E, cn.nodes)].cpt.data
4×3 DataFrame
Rowb₀AΠ
SymbolSymbolUnion…
1normal_loadroadPair{Symbol, EmpiricalDistribution}[:lb=>EmpiricalDistribution( data: [0.615248, 0.793232, 0.776366, 0.606549, 0.770395, 0.725113, 0.76165, 0.761765, 0.747987, 0.744082 … 0.692511, 0.735109, 0.764534, 0.735978, 0.730958, 0.767811, 0.777435, 0.667491, 0.734363, 0.786993] lb: 0.34113 ub: 0.865376 h: 0.00628414 c: Spline1D(knots=[0.34113,0.341182 … 0.865324,0.865376] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.20611e-20 … 1.0,1.0] (9873 elements), k=1, extrapolation="nearest", residual=0.0) ) , :ub=>EmpiricalDistribution( data: [0.615248, 0.825042, 0.810772, 0.606549, 0.805718, 0.725113, 0.798319, 0.761765, 0.747987, 0.744082 … 0.692511, 0.764751, 0.800759, 0.776597, 0.747122, 0.803532, 0.811676, 0.667491, 0.762017, 0.819763] lb: 0.349527 ub: 0.885845 h: 0.0052759 c: Spline1D(knots=[0.349527,0.349581 … 0.885791,0.885845] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.24366e-20 … 1.0,1.0] (9705 elements), k=1, extrapolation="nearest", residual=0.0) ) ]
2normal_loadoffroadPair{Symbol, EmpiricalDistribution}[:lb=>EmpiricalDistribution( data: [0.245342, 0.219849, 0.323602, 0.292521, 0.275016, 0.116332, 0.262961, 0.211862, 0.378072, 0.284628 … 0.325531, 0.167608, 0.193523, 0.349447, 0.229722, 0.32288, 0.35564, 0.308303, 0.246027, 0.38013] lb: -0.114428 ub: 0.546075 h: 0.0145795 c: Spline1D(knots=[-0.114428,-0.114362 … 0.546009,0.546075] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.49481e-20 … 1.0,1.0] (9768 elements), k=1, extrapolation="nearest", residual=0.0) ) , :ub=>EmpiricalDistribution( data: [0.434006, 0.29769, 0.492702, 0.469391, 0.456262, 0.337249, 0.447221, 0.408896, 0.533554, 0.463471 … 0.494148, 0.375706, 0.395142, 0.512085, 0.422292, 0.49216, 0.51673, 0.481227, 0.43452, 0.535098] lb: 0.160452 ub: 0.663284 h: 0.0113407 c: Spline1D(knots=[0.160452,0.160502 … 0.663234,0.663284] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.13759e-20 … 1.0,1.0] (9756 elements), k=1, extrapolation="nearest", residual=0.0) ) ]
3over_loadroadPair{Symbol, EmpiricalDistribution}[:lb=>EmpiricalDistribution( data: [0.873574, 0.849715, 0.861449, 0.891834, 0.836985, 0.892656, 0.841914, 0.703212, 0.753821, 0.603876 … 0.89888, 0.537279, 0.690926, 0.87559, 0.659721, 0.863537, 0.883645, 0.673911, 0.660057, 0.892511] lb: 0.3734 ub: 0.971388 h: 0.00857339 c: Spline1D(knots=[0.3734,0.373459 … 0.971328,0.971388] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.3676e-20 … 1.0,1.0] (9850 elements), k=1, extrapolation="nearest", residual=0.0) ) , :ub=>EmpiricalDistribution( data: [0.893025, 0.872836, 0.882764, 0.908475, 0.836985, 0.909171, 0.841914, 0.703212, 0.753821, 0.603876 … 0.914437, 0.537279, 0.690926, 0.89473, 0.659721, 0.884531, 0.901546, 0.673911, 0.660057, 0.909048] lb: 0.382308 ub: 0.977963 h: 0.00749868 c: Spline1D(knots=[0.382308,0.382367 … 0.977903,0.977963] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.36796e-20 … 1.0,1.0] (9869 elements), k=1, extrapolation="nearest", residual=0.0) ) ]
4over_loadoffroadPair{Symbol, EmpiricalDistribution}[:lb=>EmpiricalDistribution( data: [0.606711, 0.643393, 0.565926, 0.602108, 0.547655, 0.577903, 0.507001, 0.613509, 0.647897, 0.621848 … 0.589458, 0.650877, 0.571347, 0.658517, 0.630698, 0.535016, 0.602292, 0.293117, 0.575806, 0.621618] lb: 0.184055 ub: 0.789877 h: 0.0130619 c: Spline1D(knots=[0.184055,0.184116 … 0.789816,0.789877] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.37172e-20 … 1.0,1.0] (9772 elements), k=1, extrapolation="nearest", residual=0.0) ) , :ub=>EmpiricalDistribution( data: [0.656329, 0.732545, 0.674445, 0.701581, 0.660741, 0.683427, 0.630251, 0.710131, 0.735923, 0.716386 … 0.692094, 0.738158, 0.678511, 0.743887, 0.723023, 0.651262, 0.701719, 0.293117, 0.681854, 0.716214] lb: 0.205346 ub: 0.845193 h: 0.010479 c: Spline1D(knots=[0.205346,0.20541 … 0.845129,0.845193] (10000 elements), k=1, extrapolation="nearest", residual=0.0) q: Spline1D(knots=[0.0,1.45785e-20 … 1.0,1.0] (9814 elements), k=1, extrapolation="nearest", residual=0.0) ) ]

Case 4 — imprecise V, discretized, feeding a continuous functional node: MonteCarlo ​

The final combination discretizes V and feeds a continuous functional node — the continuous counterpart of Case 2. Discretization again splits V: the imprecision moves into the credal V_d, and the residual reaching E is precise. So the continuous functional node has only precise inputs and reconstructs a single precise distribution (not a p-box); a single-loop MonteCarlo is all that is needed, and the imprecision survives in V_d.

julia
V = ContinuousNode(:V, [:A], discretization_v)
V[:A => :road] = v_road
V[:A => :offroad] = v_offroad

E = ContinuousFunctionalNode(:E, [model], MonteCarlo(500))

ebn = EnhancedBayesianNetwork([A, b₀, V, C, Cₖ, K, E])
add_child!(ebn, A, V)
add_child!(ebn, [A, b₀, V, C, Cₖ, K], E)
order!(ebn)

gplot(ebn, background_color = "white", legend = true, label_size = 10, legend_x = 15, legend_y = 14)

julia
elapsed = @elapsed cn = reduce(ebn)
println("network reduced in ", round(elapsed; digits = 3), " s")
network reduced in 7.902 s
julia
gplot(cn, background_color = "white", node_scale = 1.1, title = "Reduced Credal Network", label_size = 12)

Unlike Case 3, E is now a single precise distribution; the imprecision instead lives in the discretized node V_d, whose bin probabilities are intervals:

julia
cn.nodes[findfirst(n -> n.name == :V_d, cn.nodes)].cpt.data
6×3 DataFrame
RowAV_dΠ
SymbolSymbolUnion…
1road[6.0, 8.0][0, 1]
2offroad[6.0, 8.0][0, 1]
3road[8.0, 10.0][0, 1]
4offroad[8.0, 10.0][0, 1]
5road[10.0, 13.0][0, 1]
6offroad[10.0, 13.0][0, 1]

This page was generated using Literate.jl.