The implementation is inspired by Karigl's recursive algorithm (1981) for the
autosomal case, modified to account for X-linked inheritance.
The X chromosomal pairwise identity states depend on the sexes of the two
individuals. If both are female, the states are the same as in the autosomal
case. When males are involved, the two individuals have less than 4 alleles,
hence the states differ from the autosomal ones. However, to avoid drawing
(and learning) new pictures we re-use the autosomal states by using the
following simple rule: Replace any hemizygous male allele with a pair of
autozygous alleles. In this way each X state corresponds to a unique
autosomal state.
For simplicity the output always contains 9 coefficients, but with NA's in
the positions of undefined states (depending on the sex combination). The
README file on the GitHub home page of ribd has a table illustrating this.