Ancestral Sampling & Likelihood Calculation | Directed Graphical Models