Learn R Programming

interventionalDBN (version 1.2.2)

warshall: Find the largest edge probability threshold that connects a pair of nodes.

Description

This function runs a slight variation on the Warshall algorithm to find the largest posterior edge probability threshold that allows each pair of nodes to remain connected. It is useful for calculating ROC curves based on descendancy information.

Usage

warshall(M)

Arguments

M
A square matrix of probabilities.

Value

$(i,j)$ is the largest edge probability threshold that allows $i$ to remain connected to $j$.

Details

The Warshall algorithm is $O(P)^3$, where $P$ is the number of nodes.

See Also

interventionEffects, interventionalDBN-package

Examples

Run this code
M1<-rbind(c(0.5,1,0),c(0,0,1),c(0,0,0))# A->B->C
warshall(M1)# A is upstream of B and C, B is upstream of C.
# Note that A is upstream of itself iff there is a cycle.

M2<-matrix(runif(25),5,5)
warshall(M2)

Run the code above in your browser using DataLab