[4]A=WW′/N where N is the number of SNPs and wij=(xij−2pi)/2pi(1−pi) with pi the allele frequency at SNP i. This formula for A ignores the sampling error associated with each SNP. We can improve the estimate of A by calculating a weighted average across SNPs. For a SNP i, when j ≠ k (individuals j and k), var(Aijk)=var(xij−2pi)var(xik−2pi)4pi2(1−pi)2=1; in other words, it is the same for all SNPs regardless of allele frequency. When j = k, var(Aijj)=var[(xij−2pi)2]4pi2(1−pi)2=1−2pi(1−pi)2pi(1−pi); in other words, it is dependent on the allele frequency of the SNP. We therefore use the following equation to calculate Aij,