To cite gRain in publications use:

Højsgaard S (2012). “Graphical Independence Networks with the gRain Package for R.” Journal of Statistical Software, 46(10), 1–26. doi:10.18637/jss.v046.i10, https://www.jstatsoft.org/v46/i10/.

Corresponding BibTeX entry:

  @Article{,
    title = {Graphical Independence Networks with the {gRain} Package
      for {R}},
    author = {S{\o}ren H{\o}jsgaard},
    journal = {Journal of Statistical Software},
    year = {2012},
    volume = {46},
    number = {10},
    pages = {1--26},
    doi = {10.18637/jss.v046.i10},
    url = {https://www.jstatsoft.org/v46/i10/},
  }