Packages for graphical modelling with R

This page describes some of the R packages for graphical modelling that I have been involved with. There are many more packages for grapical modelling, and the CRAN Task View gRaphical Models in R lists many of these.

1  Packages


2  Books

3  Examples

4  Scripts and notes

5  Tutorial and short courses

6  Installation

  1. The packages listed above use the graph, RBGL and Rgraphviz packages. These packages are NOT on CRAN but on bioconductor. Hence you MUST install these packages BEFORE installing the graphical modelling packages. To do so, execute these commands:
    source(""); biocLite(c("graph","RBGL","Rgraphviz"))
  2. Then install the graphical modelling packages from CRAN with:
    install.packages("gRbase", dependencies=TRUE); install.packages("gRain", dependencies=TRUE); install.packages("gRim", dependencies=TRUE)

7  Development versions of the packages

Development versions of the packages may be available here. If you decide to use these versions, please install the CRAN versions first and the afterwards install the development versions.

8  Reporting unexpected behaviours (bugs)

When reporting unexpected behaviours, bugs etc. in the packages, PLEASE supply:
  1. A reproducible example in terms of a short code fragment.
  2. The data. The preferred way of sending the data "mydata" is to copy and paste the result from running dput(mydata).
  3. The result of running the sessionInfo() function.

9  FAQ (frequently asked questions)

Is it possible to specify likelihood evidence (also called virtual evidence) in gRain?
Yes, as of version 1.1-2 this has been implemented. The function to use is setEvidence(). A vignette on the topic has also been added. Please report unexpected behaviour.
I want to build a Bayesian network with 80.000 nodes. Can I do so with gRain?
Work has been done on supporting large networks. Please report sucesses and failures.
Does gRain have support for Bayesian networks for variables that are (multivariate) normal? Or for mixtures of discrete and normal variables?
No. Implementation for the multivariate normal distribution is straight forward (if you work with the canoncical rather than the moment parameters). Any contribution would be most welcome. For mixed variables, the only algorithm I know of is numerically unstable.
Does gRain have support for Bayesian networks for variables that are not discrete (and with a finite state space)?
Not in full generality. However, using the likelihood evidence facilities, one can work with some types of non-discrete variables.
Søren Højsgaard sorenh [at] math [dot] aau [dot] dk

File translated from TEX by TTH, version 4.05.
On 16 Oct 2016, 16:51.