Skip to content
BayesVL package for Bayesian statistical analyses in R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LectureNotes v0.8.5 Jun 14, 2019
R
References
bin v0.6.5 Apr 30, 2019
data v0.8 May 17, 2019
examples
inst
man v0.8.1 May 19, 2019
.DS_Store
.Rbuildignore
.gitignore first version Dec 30, 2018
.travis.yml
BayesVL Package for Bayesian Statistical Analyses in R.pdf BayesVL Package for Bayesian Statistical Analyses in R Apr 17, 2019
BayesVL Versioning.pdf Versioning rules Apr 6, 2019
CHANGELOG.md Update CHANGELOG.md May 15, 2019
DESCRIPTION
NAMESPACE
README.md Update README.md May 23, 2019
documentation Versioning Rules Apr 6, 2019

README.md

BayesVL

The R package for visually learning the graphical structures of Bayesian networks, and performing Hamiltonian Markov chain Monte Carlo (MCMC) with 'Stan'.

Features:

* Creating the (starting) graphical structure of Bayesian networks
* Creating one or more random Bayesian networks learned from dataset with customized constraints
* Generating Stan code for structures of Bayesian networks for sampling and parameter learning
* Plotting the Bayesian network graphs 
* Performing Markov chain Monte Carlo (MCMC) simulations and plotting various graphs for posteriors check
* Compatibility with R 3.4 or newer versions

Here is the CHANGELOG

Get started

Install

Getting started and installing the latest snapshot type in the R console:

> install.packages("devtools")
> devtools::install_github("sshpa/bayesvl")

Create appropriate Bayesian network structures

Creating a node for each variable in the proposed network

dag <- bayesvl()
dag <- bvl_addNode(dag, "B")
dag <- bvl_addNode(dag, "C")
dag <- bvl_addNode(dag, "T")
dag <- bvl_addNode(dag, "DC")
dag <- bvl_addNode(dag, "MD")

Starting to add arcs between variables (nodes) using the survey data

dag <- bvl_addArc(dag, "B", "DC")
dag <- bvl_addArc(dag, "C", "DC")
dag <- bvl_addArc(dag, "T", "DC")

Generate 'Stan' code

Generating the 'Stan' code required for building structures of the Bayesian networks required for sampling and parameter learning

stan_code <- bvl_model2Stan(dag)
cat(stan_code)

Getting the model's parameters

params <- bvl_stanParams(dag)
params

Sample and fit the 'Stan' model

Sampling the predefined 'Stan' model

stan_fit <- bvl_modelFit(dag, data, iter=20000 , warmup=2000 , chains=4 , cores=4)
summary(stan_fit)
You can’t perform that action at this time.