Modeling gene duplication, loss, and coalescence