Coalescent based model of selection detection