Solution (source code)

= Solution

Label the <full siblings> at the bottom $X,Y$ and their cousin parents $F,M$. Let $F$ have parents $A,B$ and $M$ parents $C,D$, where $A,C$ are siblings with parents $U,V$. Include the other great-grandparents as $P,Q$, parents of $B$, and $R,S$, parents of $D$. This gives fourteen people, with six independent <founders in a pedigree> $U,V,P,Q,R,S$.

The <pedigree graphical model> has the following <Directed acyclic graph>, with both members of each parent pair pointing to every listed child:
$$
(U,V)\to A,C;\quad(P,Q)\to B;\quad(R,S)\to D;\quad(A,B)\to F;\quad(C,D)\to M;\quad(F,M)\to X,Y.
$$
Let $f(g)$ be the founder <genotype> law under <Hardy-Weinberg equilibrium>, and let $t(g\mid h,k)$ be the <Mendelian segregation> kernel. The joint probability of all genotypes is
$$
\begin{aligned}
p(\boldsymbol g)={}&\prod_{Z\in\{U,V,P,Q,R,S\}}f(g_Z)\,t(g_A\mid g_U,g_V)t(g_C\mid g_U,g_V)\\
&\times t(g_B\mid g_P,g_Q)t(g_D\mid g_R,g_S)t(g_F\mid g_A,g_B)t(g_M\mid g_C,g_D)\\
&\times t(g_X\mid g_F,g_M)t(g_Y\mid g_F,g_M).
\end{aligned}
$$
For a biallelic locus with allele-1 frequency $p$, $f(11)=p^2$, $f(12)=2p(1-p)$ and $f(22)=(1-p)^2$. The kernel $t$ assigns probability $1/4$ to each labelled pair of parental transmissions and adds these probabilities when they produce the same unordered genotype. Summing this <Bayesian network> factorization over unobserved genotypes gives their <marginal distribution> or a <pedigree likelihood>.

\Image[/past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2004/iii/paper-39-pedigree.png]
{title=Genotype ancestry and the two fill edges for a first-cousin marriage pedigree}