Biology Reference
In-Depth Information
shading (i.e.,
CldShadeConv == "Marked"
) influences Hailfinder's forecasts
for the plains. To investigate this influence, we use logic sampling to generate 10
7
observations from the Bayesian network learned by
mmhc(hailfinder)
.
> fitted = bn.fit(mmhc(hailfinder), hailfinder)
> n = nrow(hailfinder)
> summary(hailfinder[, "CompPlFcst"]) / n
DecCapIncIns IncCapDecIns LittleChange
0.22810 0.41205 0.35985
> cp = cpdist(fitted, nodes = "CompPlFcst",
+ (InsInMt == "Strong") & (CldShadeConv == "Marked"),
+ n = 10ˆ7)
> n = nrow(cp)
> summary(cp[, CompPlFcst]) / n
DecCapIncIns IncCapDecIns LittleChange
0.1888219
0.4812025
0.3299755
The three levels of
CompPlFcst
stand for
decreased instability
(
DecCap
IncIns
),
increased instability
(
IncCapDecIns
), and
little change
(
Little
Change
). The conditional distribution shows an increased probability of the
weather worsening (
9 %) compared to the marginal one, which suggests that bad
weather tends to spill from the mountains into the plains. This trend is confirmed
by the decreased probability of
DecCapIncIns
(
+
6
.
−
.
3
9%) and
LittleChange
(
9%).
The embarrassingly parallel nature of logic sampling results in very noticeable
performance gains even with only 2 slave processes; execution times for up to 6
slaves are shown in Fig.
5.8
.
−
2
.
> system.time(cpdist(fitted, nodes = "CompPlFcst",
+ (InsInMt == "Strong") & (CldShadeConv == "Marked"),
+
n = 10ˆ7, batch = 10ˆ6))
400
350
300
250
200
150
1
2
3
4
5
6
number of slaves
Fig. 5.8
Performance of conditional probability queries for different numbers of slave processes,
measured by its execution time (in seconds)
Search WWH ::
Custom Search