shd {pcalg} | R Documentation |
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.
shd(g1,g2)
g1 |
graph object |
g2 |
graph object |
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.
The value of the SHD (numeric).
Markus Kalisch kalisch@stat.math.ethz.ch and Martin Maechler
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.
## generate two graphs g1 <- randomDAG(10, prob = 0.2) g2 <- randomDAG(10, prob = 0.2) ## comute SHD shd.val <- shd(g1,g2)