Learn R Programming

stCEG (version 0.1.0)

calculate_path_products: Calculate Path Products in a Chain Event Graph (CEG)

Description

This function calculates the products of probabilities along all paths from a specified root node in a Chain Event Graph (CEG). It traverses the graph, multiplying the posterior means of the edges for each path, and returns the resulting paths and their products.

Usage

calculate_path_products(nodes_df, edges_df, root_node = "w0")

Value

A data frame with two columns:

path

The sequence of nodes in the path, as a string of node labels separated by " -> "

product

The product of the posterior means along the path

Arguments

nodes_df

A data frame representing the nodes in the CEG.

edges_df

A data frame representing the edges in the CEG, containing columns for from, to, label1, and posterior_mean.

root_node

A string specifying the label of the root node from which to start the traversal. Default is "w0".