210 Bayesian Networks: With Examples in R
> nrow(directed.arcs(dag100))
[1] 0
> nrow(undirected.arcs(dag100))
[1] 2
While both DAGs are very different from that in Figure 1.1, dag100
has only a single arc; not enough information is present in the first
100 observations to learn the correct structure. In both cases all arcs
are undirected. After assigning directions with cextend, we can see
that dag100 has a much lower score than dag, which confirms that
dag100 is not as good a fit for the data as dag.
> score(cextend(dag), survey, type = "bic")
[1] -1999.259
> score(cextend(dag100), survey, type = "bic")
[1] -2008.116
3. The BIC score computed from the first 100 observations does not
increase when using Monte Carlo tests, and the DAGs we learn
still have just