Compare two sets of haplotypes (matrices), and return the proportion of identical sites over all pairwise comparisons. Values can be any numeric value; for example if values represent ancestry then this function returns the average identity by descent, or if values represent alleles then it returns the average identity by state.
get_haplotype_identity(mat1, mat2)matrices representing sets of haplotypes to compare. Haplotypes are in rows and loci are in columns.