Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bn.fit.plots

Plot fitted Bayesian networks


Description

Plot functions for the bn.fit, bn.fit.dnode and bn.fit.gnode classes, based on the lattice package.

Usage

## for Gaussian Bayesian networks.
bn.fit.qqplot(fitted, xlab = "Theoretical Quantiles",
  ylab = "Sample Quantiles", main, ...)
bn.fit.histogram(fitted, density = TRUE, xlab = "Residuals",
  ylab = ifelse(density, "Density", ""), main, ...)
bn.fit.xyplot(fitted, xlab = "Fitted values", ylab = "Residuals", main, ...)
## for discrete (multinomial and ordinal) Bayesian networks.
bn.fit.barchart(fitted, xlab = "Probabilities", ylab = "Levels", main, ...)
bn.fit.dotplot(fitted, xlab = "Probabilities", ylab = "Levels", main, ...)

Arguments

fitted

an object of class bn.fit, bn.fit.dnode or bn.fit.gnode.

xlab, ylab, main

the label of the x axis, of the y axis, and the plot title.

density

a boolean value. If TRUE the histogram is plotted using relative frequencies, and the matching normal density is added to the plot.

...

additional arguments to be passed to lattice functions.

Details

bn.fit.qqplot() draws a quantile-quantile plot of the residuals.

bn.fit.histogram() draws a histogram of the residuals, using either absolute or relative frequencies.

bn.fit.xyplot() plots the residuals versus the fitted values.

bn.fit.barchart() and bn.fit.dotplot plot the probabilities in the conditional probability table associated with each node.

Value

The lattice plot objects. Note that if auto-printing is turned off (for example when the code is loaded with the source function), the return value must be printed explicitly for the plot to be displayed.

Author(s)

Marco Scutari

See Also


bnlearn

Bayesian Network Structure Learning, Parameter Learning and Inference

v4.6.1
GPL (>= 2)
Authors
Marco Scutari [aut, cre], Robert Ness [ctb]
Initial release
2020-09-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.