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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/warshall.R

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

1

Arguments

M

A square matrix of probabilities.

Details

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

Value

A square matrix, where element (i,j) is the largest edge probability threshold that allows i to remain connected to j.

Author(s)

Simon Spencer

See Also

interventionEffects, interventionalDBN-package

Examples

1
2
3
4
5
6
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)

interventionalDBN documentation built on May 30, 2017, 8:24 a.m.