shd {pcalg}R Documentation

Compute Structural Hamming Distance (SHD)

Description

Computer the Structural Hamming Distance between two graphs. In simple terms, this is the number of edge instertion, deletions or flips in order to transform one graph to another graph.

Usage

shd(g1,g2)

Arguments

g1 graph object
g2 graph object

Details

The "standard" method envokes a standard correlation estimator. "Qn" envokes a robust, elementwise correlation estimator based on the Qn scale estimte. "QnStable" also uses the Qn scale estimator, but uses an improved way of transforming that into the correlation estimator. "ogkQn" envokes a correlation estimator based on Qn using OGK.

Value

The value of the SHD (numeric).

Author(s)

Markus Kalisch kalisch@stat.math.ethz.ch and Martin Maechler

References

I. Tsamardinos, L.E. Brown and C.F. Aliferis (2006), "The Max-Min Hill-Climbing Bayesian Network Structure Learning Algorithm"; JMLR, Vol. 65, 31-78.

See Also

pcAlgo

Examples

## generate two graphs
g1 <- randomDAG(10, prob = 0.2)
g2 <- randomDAG(10, prob = 0.2)
## comute SHD
shd.val <- shd(g1,g2)

[Package pcalg version 0.1-9 Index]