Biology Reference
In-Depth Information
In this case, the difference in execution time between the parallel and the
optimized versions of Inter-IAMB is much smaller, because the extra time
required by permutation tests (compared to shrinkage ones) makes the overhead
of the
snow
cluster much less noticeable.
5.3
Consider again the
alarm
data set from Exercise
5.2
, and a snow cluster
with at least
2
nodes.
(a) Use nonparametric bootstrap to determine the distribution of the number
of arcs present in a network structure learned with
hc
.
(b) How does that distribution change when bootstrap samples have size
m=
100
?
(c) Compare the distribution of the number of score comparisons for
m=
100
and
m = 5000
.
(a)
> library(snow)
> cl = makeCluster(2, type = "SOCK")
> clusterSetupSPRNG(cl)
> n = bn.boot(alarm, narcs, R = 50,
+ algorithm = "hc", cluster = cl)
> hist(unlist(n))
The distribution of the number of arcs is very tight around 55. It is skewed to
the left and varies in the range
. This suggests that the sample size of
alarm
is large enough to reliably learn the structure of the network.
(b)
> n = bn.boot(alarm, narcs, R = 50, m = 1000
+ algorithm = "hc", cluster = cl)
> hist(unlist(n))
The distribution of the number of arcs has a much greater spread the one studied
in the previous point; it varies in the range
[
53
,
58
]
. Its expectation is also much
smaller than before. Furthermore, the distribution is not as skewed as before.
(c)
> n1 = bn.boot(alarm, ntests, R = 50, m = 100,
> algorithm = "hc", cluster = cl)
> n2 = bn.boot(alarm, ntests, R = 50, m = 5000,
> algorithm = "hc", cluster = cl)
> par(mfrow = c(1, 2))
> hist(unlist(n1), main = "m = 100")
> hist(unlist(n2), main = "m = 5000")
> stopCluster(cl)
The number of network scores computed for
m = 5000
is greater than the cor-
responding number for
m = 100
; the former varies in the range
[
24
,
36
]
[
2466
,
2610
]
,
while the latter in
[
1602
,
1854
]
. Both distributions are skewed on the left and
have similar spreads.
5.4
Implement a parallel version of the model averaging performed using
hc
with random starting networks in Sect.
2.5.1
.
Search WWH ::
Custom Search