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.
calculate_path_products(nodes_df, edges_df, root_node = "w0")
A data frame with two columns:
The sequence of nodes in the path, as a string of node labels separated by " -> "
The product of the posterior means along the path
A data frame representing the nodes in the CEG.
A data frame representing the edges in the CEG, containing columns for from
, to
,
label1
, and posterior_mean
.
A string specifying the label of the root node from which to start the traversal. Default is "w0".