The formula used is inspired from MSA software :
$$D_{PS}=1-\frac{\sum_{d}^{D}\sum_{k}^{K}\min (f_{a_{kd}i},f_{a_{kd}j})}{D} $$
such as \(a_{kd}\) is the allele \(k\) at locus \(d\)
\(D\) is the total number of loci
\(K\) is the allele number at each locus
\(\gamma_{a_{kd^{ij}}}=0\) if individuals \(i\) and \(j\)
do not share allele \(a_{kd}\)
\(\gamma_{a_{kd^{ij}}}=1\) if one of individuals \(i\) and \(j\)
has a copy of \(a_{kd}\)
\(\gamma_{a_{kd^{ij}}}=2\) if both individuals have 2 copies
of \(a_{kd}\) (homozygotes)
\(f_{a_{kd}i}\) is allele \(a_{kd}\) frequency in
individual \(i\) (0, 0.5 or 1).
More information in :
Bowcock et al., 1994
and Microsatellite Analyser software (MSA) manual.
This function uses functions from adegenet package
Note that in the paper of Bowcock et al. (1994), the denominator is 2D.
But, in MSA software manual, the denominator is D.