Biology Reference
In-Depth Information
user system elapsed
385.632 26.798 412.549
> cl = makeCluster(2, type = "MPI")
> system.time(cpdist(fitted, nodes = "CompPlFcst",
+ (InsInMt == "Strong") & (CldShadeConv == "Marked"),
+ n = 10ˆ7, cluster = cl))
user system elapsed
8.713 0.244 191.079
> stopCluster(cl)
The application of logic sampling to the estimation of conditional probabilities,
instead of whole distributions, shows similar performance improvements. Consider,
for example, the probability that the wind is blowing toward the west in the moun-
tains (i.e., WindFieldMt == "Westerly" ) conditional to the fact that it is
blowing from east/northeast in the plains (i.e., WindFieldPln == "E NE" ).
> cpquery(fitted, (WindFieldMt == "Westerly"),
+ (WindFieldPln == "E_NE"), n = 10ˆ7)
[1] 0.4136172
> n = nrow(hailfinder)
> summary(hailfinder[, "WindFieldMt"]) / n
LVorOther Westerly
0.47615
0.52385
The conditional probability is lower than the marginal one because the plains and
the mountains are adjacent and winds cannot completely change in direction so
suddenly.
Using two slave processes again halves the execution time.
> system.time(cpquery(fitted,
+ (WindFieldMt == "Westerly"),
+ (WindFieldPln == "E_NE"), n = 10ˆ7, batch = 10ˆ6))
user system elapsed
291.439 14.889 306.328
> cl = makeCluster(2, type = "MPI")
> system.time(cpquery(fitted,
+ (WindFieldMt == "Westerly"),
+ (WindFieldPln == "E_NE"), n = 10ˆ7, cluster = cl))
user system elapsed
0.004 0.004 178.921
> stopCluster(cl)
Adding more slave processes to the cluster improves the execution time of cpquery
even further, as was the case for cpdist in the previous example.
Search WWH ::




Custom Search