Compute the permutation of the rows of hat.z that has to be applied to obtain the "same order" as z. Compute optimal matching between 2 clusterings using Hungarian algorithm.
permuteZEst(z, hat.z)
Matrix of size \(Q \times n\)
Matrix of size \(Q \times n\)
HUBERT, L. & ARABIE, P. (1985). Comparing partitions. J. Classif. 2, 193–218.
MATIAS, C., REBAFKA, T. & VILLERS, F. (2018). A semiparametric extension of the stochastic block model for longitudinal networks. Biometrika. 105(3): 665-680.