Learn R Programming

pcalg (version 1.1-4)

shd: 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

Value

  • The value of the SHD (numeric).

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.

References

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

Examples

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

Run the code above in your browser using DataLab