Population structure due to phylogenetic relationships between subjects can cause inaccurate predictions in association studies. The confounding effects of this structure have been revisited in multiple biological disciplines resulting in a disparate collection of proposed solutions. With few exceptions, these solutions fall short in one of two ways: they seek only to calibrate p-values (e.g., Genomic Control); or they assume a flat population structure (e.g., Structured Association, PCA). I will discuss statistical models, known as generative or graphical models that explicitly address both these issues. I'll show that these models identify associations with fewer false positives and false negatives than existing methods, and provide a method that accurately estimates the false positive rate of associations identified by the models. I'll demonstrate the utility of these models in several domains including HLA-mediated immune pressure on HIV evolution, networks of compensatory mutations in an HIV protein, and a genome wide association (GWA) study in which standard population structure-correcting methods are known to fail.