Skip to content

USCbiostats/bayesnetworks

Repository files navigation

bayesnetworks

Build Status Lifecycle: experimental CRAN status

The goal of bayesnetworks is to do MCMC fitting of Bayesian networks, including source & sink constraints and external network info.

Installation

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("USCbiostats/bayesnetworks")

Examples

The network is fitted by passing in data and network structure

library(bayesnetworks)
set.seed(1234)

x <- bn_mcmc(X = network$data, graph = network$dag_info, N = 50000)

Some diagnostic plots:

library(ggplot2)

ggplot(x, aes(iter, globalLL)) +
  geom_line()

ggplot(x, aes(iter, FN)) +
  geom_line(aes(color = "FN")) +
  geom_line(aes(y = FP, color = "FP")) +
  labs(y = "value")

ggplot(x, aes(iter, deletions)) +
  geom_line(aes(color = "deletions")) +
  geom_line(aes(y = additions, color = "additions")) +
  labs(y = "count")

Code of Conduct

Please note that the ‘bayesnetworks’ project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

C++ program to fit Bayesian networks, illustrated with simulated data from P3 of our IMAGE grant application

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published