Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Learning Bayesian Networks with the bnlearn R Package

bnlearn lets users pair any structure learner with any statistical test or score

  • Problem Bayesian network structure learning usually ties each algorithm to one statistical criterion. Users cannot pick the combination that suits their data, because the search and the test are fixed together.
  • Method bnlearn is an R package that separates the search procedure from the statistic used to judge candidate networks. It offers constraint-based and score-based learners, and users pair any learner with any test or score.
  • Results On the learning.test data, three other constraint-based learners matched the Grow-Shrink network exactly.

Why learning the graph is hard

A Bayesian network is a directed acyclic graph whose nodes are random variables and whose arcs stand for probabilistic dependencies. Recovering that graph from data is hard because the number of candidate structures climbs quickly as variables are added. Exhaustive search only works for the smallest data sets, so every algorithm has to prune the space in some way.

Practical methods also split the job: they learn the graph first and estimate each local distribution afterwards, which avoids modelling the full joint distribution.

The literature has mostly studied two cases, discrete and continuous data. Discrete data use multinomial distributions stored as contingency tables, and this is by far the most common setting. Continuous data are usually modelled as multivariate normal, which gives Gaussian Bayesian networks with linear constraints between nodes. Other distributional assumptions exist, but they bring more complex algorithms or limits, such as a mixed-variable approach that forbids a continuous parent of a discrete node.

Separating the algorithm from the criterion

The key idea is to decouple the search procedure from the statistic used to judge a candidate network. In a reference implementation the algorithm is usually fixed to one criterion, so users can't pick the combination that suits their data. bnlearn offers both constraint-based and score-based learners and lets the user pair a learner with a test or score.

Constraint-based algorithms read the structure off conditional independence tests, then build a graph that satisfies the resulting d-separation statements. Score-based algorithms instead give each candidate network a score and run a heuristic search to maximize it. The reason to keep the two apart is that the best combination depends on the data at hand.

How constraint-based learning runs

The Inductive Causation algorithm underlies the constraint-based family and runs in three steps. First it learns the skeleton, the undirected graph underlying the network, restricting each search to the Markov blanket of a node. Then it orients the arcs of every v-structure, a converging connection \( X_j \rightarrow X_i \leftarrow X_k \).

Last, it orients the remaining arcs so that the graph stays acyclic.

Grow-Shrink learns each Markov blanket with the simplest detection method in this family. IAMB adds nodes by forward selection and then removes false positives, while inter.iamb interleaves forward stepwise selection to avoid them during detection. fast.iamb uses speculative stepwise forward selection to cut the number of tests. mmpc selects neighbours by maximizing the minimum association with any subset chosen earlier, and its arcs stay undirected.

Each constraint-based algorithm comes in three versions. The optimized default uses backtracking, which roughly halves the number of independence tests. The unoptimized version follows the original description closely, which helps compare learners and tests against each other. The parallel version needs a cluster built with makeCluster from snow and passed in through the cluster argument.

Tests and scores behind the learners

For discrete data every test is a function of the observed frequencies \( n_{ijk} \) and of the conditioning configurations. Mutual information sums the frequencies against their expected counts on a log scale, as \[ MI(X,Y \mid Z)=\sum_{i,j,k}\frac{n_{ijk}}{n}\,\log\frac{n_{ijk}\,n_{++k}}{n_{i+k}\,n_{+jk}} \] Mutual information is the test the Grow-Shrink run on learning.test uses.

Pearson's X² uses expected counts built from the marginal totals, \( m_{ijk}=\frac{n_{i+k}\,n_{+jk}}{n_{++k}} \). Both mutual information and X² come with an asymptotic χ² version and a Monte Carlo permutation version. The fast mutual information is set to zero unless there are at least five data per parameter. The experimental aict test instead compares the mutual information with a threshold built from the number of levels and the sample size.

For continuous data the tests depend on the partial correlation coefficients \( \rho_{XY \mid Z} \). The linear correlation test has a Student's t version and a Monte Carlo version. Fisher's Z transforms the correlation, the same transformation used by TETRAD and the pcalg package. The continuous mutual information is \( MI_g=-\tfrac{1}{2}\log(1-\rho^2_{XY \mid Z}) \).

The discrete scores are the likelihood, the log-likelihood, AIC, BIC, bde and K2. bde is score equivalent, but K2 is not. The only continuous score is bge, a Gaussian posterior density that follows a Wishart distribution.

Encoding prior knowledge as arcs

Prior knowledge enters through the blacklist and whitelist arguments, which force arcs to be absent or present. An arc whitelisted in both directions stays in the graph, but its orientation is left to the learner. An arc blacklisted in both directions, along with its undirected version, is never present. Whitelisting one direction fixes that direction and rules out the reverse, while blacklisting one direction removes only that direction.

Worked example on learning.test

learning.test holds 5000 observations of six discrete variables, A to E with three levels each and F with two. Grow-Shrink returns five arcs, one undirected and four directed, after 43 tests. iamb, fast.iamb and inter.iamb each compare equal to that network.

Hill-climbing with the AIC score returns a fully directed network after 40 tests. It doesn't compare equal to the Grow-Shrink network, because the arc between A and B points one way in one and is undirected in the other. The two orientations of A and B can't be told apart by score, since score equivalence holds for every score except K2.

Blacklisting one direction forces the other, and the resulting network compares equal to the hill-climbing network. Under bde both orientations scored -24002.36, so the score alone can't choose between them.

ALARM network: learner accuracy and cost

The ALARM network has 37 discrete variables and 46 arcs, and the alarm data set holds 20000 samples drawn from it.

Grow-Shrink ran 1727 conditional independence tests, while the constraint-based learners all ran between 1727 and 3106 tests. Hill-climbing performed 2841 network score comparisons, a count that the authors compare with the tests of the other learners.

Hill-climbing learned 53 arcs, compared to 42 to 45 arcs for the constraint-based learners. The authors point out that this is about ten more arcs than the other learners. Execution took 13.54360 for Grow-Shrink and 72.38705 for hill-climbing on an Intel Core 2 Duo machine with 1GB of RAM.

Monte Carlo X2 tests on ALARM

The probability structure of ALARM produces many sparse contingency tables. Grow-Shrink with the parametric X² test missed 12 arcs of the network. With the Monte Carlo version of X², run with B = 10000, it identified all but five arcs.

The authors attribute the gap to the sparse tables, where the asymptotic approximation is least reliable. This comparison rests on one sample of 20000 observations from ALARM.

Marks data: continuous conditional independence

The marks data hold examination marks for 88 students in five subjects. Under multivariate normality the question reduces to partial correlations, and some of them are clearly not significant.

The linear correlation test of STAT and VECT given ALG gives cor = 0.0527 with p-value = 0.628. The Fisher's Z test gives 0.6289112, the Monte Carlo correlation test 0.6332 and the mi-g test 0.6209406, so the conclusion doesn't depend on the test.

All learners agree up to arc direction, and analysis and statistics are conditionally independent of mechanics and vectors given algebra.

Limitations

mmpc returns only undirected arcs and makes no attempt to detect their orientation. K2 isn't score equivalent, so the two orientations of an arc need not score alike. Parametric tests miss more arcs on sparse tables, as the ALARM case shows.

The examples are small: learning.test with six variables, one ALARM sample of 20000, and a single continuous example, marks. Execution times come from one machine.

Paper info

Authors
Marco Scutari
Venue
arXiv · Preprint
First published
2009-8-26
Added
2026-11-12
Updated
2010-7-10
Version
v2
arXiv
0908.3817
Category
stat.ML
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Marco Scutari (2009). Learning Bayesian Networks with the bnlearn R Package. arXiv:0908.3817v2. https://arxiv.org/abs/0908.3817v2

BibTeX
@misc{scutari2009learning,
  title = {{Learning Bayesian Networks with the bnlearn R Package}},
  author = {Marco Scutari},
  year = {2009},
  eprint = {0908.3817},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/0908.3817v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up