Compute the structural Hamming distance between the true CPDAG cpdag and the estimated CPDAG est_cpdag. The structural Hamming distance is defined as in the paper from Tsamardinos I., Brown L.E., and Aliferis C.F., https://link.springer.com/article/10.1007/s10994-006-6889-7.

compute_str_ham_distance(cpdag, est_cpdag)

Arguments

cpdag

Square binary matrix. A matrix representing a CPDAG.

est_cpdag

Square binary matrix. The estimated CPDAG.

Value

Numeric --- between 0 and 1. The structural Hamming distance between a true CPDAG cpdag and the estimated CPDAG est_cpdag.