Learn R Programming

Hybrid Bayesian Networks Using R and JAGS

Facilities for easy implementation of hybrid Bayesian networks using R. Bayesian networks are directed acyclic graphs representing joint probability distributions, where each node represents a random variable and each edge represents conditionality. The full joint distribution is therefore factorized as a product of conditional densities, where each node is assumed to be independent of its non-desendents given information on its parent nodes. Since exact, closed-form algorithms are computationally burdensome for inference within hybrid networks that contain a combination of continuous and discrete nodes, particle-based approximation techniques like Markov Chain Monte Carlo are popular. We provide a user-friendly interface to constructing these networks and running inference using rjags. Econometric analyses (maximum expected utility under competing policies, value of information) involving decision and utility nodes are also supported.

HydeNet may be installed using

install.packages("HydeNet")

Patched versions from GitHub may be installed using

setRepositories(ind=1:2)
devtools::install_github("nutterb/HydeNet")

Please note that you may need to use the ref argument in install_github to get the latest updates. Please visit the GitHub repository to explore branches of the project.

The package includes a colletion of vignettes to help you get started. Use vignette(package = "HydeNet") to see the complete listing of vignettes.

Copy Link

Version

Install

install.packages('HydeNet')

Monthly Downloads

86

Version

0.10.11

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Benjamin Nutter

Last Published

July 6th, 2020

Functions in HydeNet (0.10.11)

factorFormula

Convert Factor Levels in Formula to Numeric Values
compileJagsModel

Compile Jags Model from a Hyde Network
writeNetworkModel

Generate JAGS Code for a Network's Model
jagsDists

JAGS Probability Distributions.
writeJagsModel

Write a Node's JAGS Model
%>%

Chain together multiple operations.
bindSim

Bind Output From coda Samples
compileDecisionModel

Compile JAGS Models to Evaluate the Effect of Decisions in a Network
modelToNode

Convert a Model Object to a Network Node
inputCPTExample

Example Conditional Probability Table Resulting from the inputCPT function.
print.HydeSim

Print a Hyde Simulated Distribution Object
factorRegex

Produce Regular Expressions for Extracting Factor Names and Levels
policyMatrix

Construct Policy and Decision Matrices
TranslateFormula

Translate R Formula to JAGS
SE.cpt

Conditional Probability Table for side effects as a function of emesis and drug.
writeJagsFormula

Write the JAGS Formula for a Hyde Node
vectorProbs

Convert a vector to JAGS Probabilities
HydeNetwork

Define a Probablistic Graphical Network
print.cpt

Print Method for CPT objects
setPolicyValues

Assign Default Policy Values
expectedVariables

List Expected Parameter Names and Expected Variables Names
cpt

Compute a conditional probability table for a factor given other factors
plot.HydeNetwork

Plotting Utilities for Probabilistic Graphical Network
setNode

Set Node Relationships
setNodeModels

Set Node Properties Using Model Objects
mergeDefaultPlotOpts

rdname plot.HydeNetwork
jagsFunctions

JAGS Functions Compatible with R.
update.HydeNetwork

Update Probabilistic Graphical Network
print.HydeNetwork

Print a HydeNetwork
rewriteHydeFormula

Rewrite HydeNetwork Graph Model Formula
setDecisionNodes

Classify Multiple Nodes as Decision or Utility Nodes
BJDealer

Blackjack Dealer Outcome Probabilities
HydeNetSummaries

HydeNet Summary Objects
HydeUtilities

Hyde Network Utility Functions
HydeSim

Simulated Distributions of a Decision Network
PE

Pulmonary Embolism Dataset
BlackJack

Black Jack Hybrid Decision Network
BlackJackTrain

Black Jack Network Training Dataset
Resolution.cpt

Conditional Probability Table for resolution of side effects as a function drugs and emesis.
Hyde-package

Hydbrid Decision Networks