bayesvl-class: Class 'bayesvl': Object Class for BayesVL Models

bayesvl-classR Documentation

Class bayesvl: Object Class for BayesVL Models

Description

An S4 class that represents a Bayesian model created using the bayesvl package. This object is typically returned by functions such as bayesvl.

Slots

call

Original function call that created the model.

nodes

List of nodes in the model.

arcs

List of arcs (edges) connecting the nodes.

pars

List of model parameters.

stanfit

An object of class stanfit, representing the fitted Stan model.

rawdata

A data frame containing observed input data.

standata

Data list used for Stan sampling.

posterior

A data frame representation of posterior draws from the stanfit object.

elapsed

Elapsed time for the MCMC simulation (in seconds).

Methods

show

signature(object = "bayesvl"): Prints a default summary of the model.

summary

Displays a more detailed overview of the model structure and output.

References

For documentation, case studies, worked examples, and other tutorial materials, visit our GitHub:

For case studies using the package in research articles, refer to:

See Also

bayesvl

Examples

# Design the model in a directed acyclic graph
model <- bayesvl()

# Add observed data nodes to the model
model <- bvl_addNode(model, "Lie", "binom")
model <- bvl_addNode(model, "B", "binom")
model <- bvl_addNode(model, "C", "binom")
model <- bvl_addNode(model, "T", "binom")

# Add paths between nodes
model <- bvl_addArc(model, "B", "Lie", "slope")
model <- bvl_addArc(model, "C", "Lie", "slope")
model <- bvl_addArc(model, "T", "Lie", "slope")

# Summarize the model
summary(model)

bayesvl documentation built on June 8, 2025, 10:38 a.m.