This is a very simple case of IBD, where there is no uncertainty about the relationship between the two untyped actors - and it is a close relationship, father-son (denoted 1 and 2 respectively).

I calculate the conditional distribution of $n_{2a}|\{n_{1b},b=1,2,\ldots,A\},\{n_{2b},b<a\}$ as follows
 $P(n_{2a}=..)$ $n_{1a}$ $S_{1a}$ $S_{2,a-1}$ 0 1 2 0 0 0 $1-q_a^\star$ $q_a^\star$ 0 1 0 0 - - - 2 0 0 - - - 0 1 0 $1-q_a^\star$ $q_a^\star$ 0 1 1 0 $(1-q_a^\star)/2$ 0.5 $q_a^\star/2$ 2 1 0 - - - 0 2 0 - - - 1 2 0 0 $1-q_a^\star$ $q_a^\star$ 2 2 0 0 $1-q_a^\star$ $q_a^\star$ 0 0 1 1 0 0 1 0 1 - - - 2 0 1 - - - 0 1 1 $1-q_a$ $q_a$ 0 1 1 1 0.5 0.5 0 2 1 1 - - - 0 2 1 $1-q_a^\star$ $q_a^\star$ 0 1 2 1 $1-q_{\leq a}$ $q_{\leq a}$ 0 2 2 1 0 1 0 0 0 2 - - - 1 0 2 - - - 2 0 2 - - - 0 1 2 1 0 0 1 1 2 - - - 2 1 2 - - - 0 2 2 1 0 0 1 2 2 1 0 0 2 2 2 - - -

which is (should be) equivalent to the previous version:

 $P(n_{2a}=..)$ $n_{1a}$ $U_{1a}$ $S_{2,a-1}$ 0 1 2 0 0 0 - - - 1 0 0 0 $1-q_a^\star$ $q_a^\star$ 2 0 0 0 $1-q_a^\star$ $q_a^\star$ 0 1 0 $1-q_a^\star$ $q_a^\star$ 0 1 1 0 $(1-q_a^\star)/2$ 0.5 $q_a^\star/2$ 2 1 0 - - - 0 2 0 $1-q_a^\star$ $q_a^\star$ 0 1 2 0 - - - 2 2 0 - - - 0 0 1 $1-q_a^\star$ $q_a^\star$ 0 1 0 1 $1-q_{\leq a}$ $q_{\leq a}$ 0 2 0 1 0 1 0 0 1 1 $1-q_a$ $q_a$ 0 1 1 1 0.5 0.5 0 2 1 1 - - - 0 2 1 1 0 0 1 2 1 - - - 2 2 1 - - - 0 0 2 1 0 0 1 0 2 1 0 0 2 0 2 - - - 0 1 2 1 0 0 1 1 2 - - - 2 1 2 - - - 0 2 2 - - - 1 2 2 - - - 2 2 2 - - -

Notation: - means impossible, $q_a$ are the allele frequencies, $q_{\leq a}$ the cumulative sums of the $q_a$, and $q_a^\star = q_a/\sum_{b\geq a} q_b$.

The way I did it was messy and I can hardly read my own notes! The first point is that I got the jt distrn of S_{2,a-1} and n_{2a} given n_{1a} and U_{1,a}, then conditioned out the S_{2,a-1} - that was the approach for all the cells.

Now, for this line of the table, the father has 1 allele <a, 1 allele =a, and 0 alleles>a.
With probability 1/2 each, the IBD allele is <a or =a, so conditioning on this split:
P(S_{2,a-1}, n_{2a}) = (1,1) | n_{1a} and U_{1,a}) = 1/2 * q_a + 1/2 * q_{<a}
P(S_{2,a-1}, n_{2a}) = (1,0) | n_{1a} and U_{1,a}) = 1/2 * q_{>a} +1/2 * 0
.. and there are no other possibilities with S_{2,a-1}=1. These sum to 1/2, so we get the conditional probs in the table by multiplying by 2.

I think that amounts to a general method - i.e. always look at joint for S_{2,a-1} and n_{2a} given n_{1a} and U_{1,a} first, and use <a, =a , >a as the only 3 categories we need to consider for the individual 2's alleles.

Would be good if you could do a more general case! Is there a simple way to parametrise the relationship between the individuals, so as to be able to use the same argument - e.g. (wishful thinking) - is it always 0, 1 or 2 alleles copied by IBD (probs p,q,r) and any others indeptly from the gene pool?

> dump(c('FatherSonFreq','TUSn','form'),'')
FatherSonFreq <-
function (Tval,Uval,Svan,nval,TUSN,form,a,q,qcum,qstar)
{
nrows<-length(Tval)
tab<-as.vector(TUSn%*%(10^(3:0)))
input<-cbind(Tval,Uval,Sval,nval)%*%(10^(3:0))
freq<-rep(0,nrows)
j<-match(input,tab)
k<-as.numeric(form[j])
freq[is.na(j)]<-1/3
freq[!is.na(j)&!is.na(k)]<-k[!is.na(j)&!is.na(k)]
# to be finished
}
TUSn <-
structure(c(0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0,
0, 2, 2, 2, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 2, 2, 2, 1, 1,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,
1, 0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1,
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1,
2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1,
2, 0, 1, 2), .Dim = c(42L, 4L))
form <-
c("1", "0", "0", "1", "0", "0", "1", "0", "0", "A", "B", "0",
"C", "D", "0", "E", "F", "0", "0", "1", "0", "0.5", "0.5", "0",
"1", "0", "0", "0", "A", "B", "A", "B", "0", "0", "A", "B", "G",
"0.5", "H", "A", "B", "0")