This function takes a DAG with edgeweights as input and computes the causal effects of all nodes on all direct and indirect children in the DAG. Alternatively see pcalg::causalEffect for pairwise computation.

trueEffects(g, partial = FALSE)

Arguments

g

graphNEL object

partial

if FALSE computes the total causal effects and not just the partial edge effects

Value

matrix of causal effects

Author

Martin Pirkl

Examples

graph.wt <- as(matrix(c(0,0,0,1,0,0,0,1,0), 3), "graphNEL")
trueEffects(graph.wt)
#>   1 2 3
#> 1 0 1 1
#> 2 0 0 1
#> 3 0 0 0