bbn.predict: Bayesian Belief Network Prediction

View source: R/bbn.predict.R

bbn.predictR Documentation

Bayesian Belief Network Prediction

Description

bbn.predict performs predictions using a Bayesian Belief Network (BBN) model, accommodating multiple priors scenarios and allowing for bootstrapping to assess variability.

Usage

bbn.predict(
  bbn.model,
  ...,
  boot_max = 1,
  values = 1,
  figure = 1,
  font.size = 5
)

Arguments

bbn.model

A matrix or dataframe of interactions between different model nodes.

...

An X by 2 array of initial changes to the system under investigation. It requires at least 1 prior scenario (up to 12 priors). The first column should be a -4 to 4 (including 0) integer value for each node in the network with negative values indicating a decrease and positive values representing an increase. 0 represents no change. Note, names included here are included as outputs in tables and figures. Shortening these names can provide better figures.

boot_max

The number of bootstraps to perform. Suggested range for exploratory analysis 1-1000. For final analysis recommended size = 1000 - 10000 - note, this can take a long time to run. Default value is 1, running with no bootstrapping - suitable for exploration of data and error checking.

values

This provides a numeric output of posterior values and any confidence intervals. Default value 1. Set to 0 to hide this output.

figure

Sets the figure options. Default value 1. 0 = no figures produced. 1 = figure is saved in working directory as a PDF file (note, this is overwritten if the name is not changed, and no figure is produced if the existing PDF is open when the new one is generated). 2 = figure is produced in a graphics window. All figures are combined on a single plot where scenario 2 is below scenario 1 (i.e. scenarios work in columns then rows)

font.size

Font size for the plot labels. Defaults to 5.

Details

  • Supports input of multiple priors through ellipsis().

  • Allows bootstrapping with a specified number of maximum iterations to assess prediction variability.

  • Generates plots for visual representation of the predictions.

Value

Plots of the (BBN) predictions and optionally prints the predicted values.

Examples

data(my_BBN, combined)
# Run the prediction
bbn.predict(bbn.model = my_BBN, priors1 = combined, boot_max=100, values=1, figure=1, font.size=5)


bbnet documentation built on Aug. 18, 2025, 5:32 p.m.